openstack zone list --all-projects doesn't work.

Bug #1647926 reported by Andrew Spiers
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-designateclient
New
Undecided
Unassigned
python-openstackclient
Invalid
Undecided
Unassigned

Bug Description

Hi, with out the --all-projects switch, the command works.

Speculating a bit, It looks like maybe the bug is in how keystoneauth1 calls requests,

Here's the debug output:

$ openstack zone list --all-projects --debug
START with options: ['zone', 'list', '--all-projects', '--debug']
options: Namespace(access_token='***', access_token_endpoint='', access_token_type='', auth_type='', auth_url='http://keystone.dev.rc.nectar.org.au:5000/v2.0/', cacert=None, cert='', client_id='', client_secret='***', cloud='', code='', debug=True, default_domain='default', default_domain_id='', default_domain_name='', deferred_help=False, discovery_endpoint='', domain_id='', domain_name='', endpoint='', identity_provider='', insecure=None, interface='', key='', log_file=None, openid_scope='', os_beta_command=False, os_compute_api_version='', os_dns_api_version='2', os_identity_api_version='', os_image_api_version='', os_network_api_version='', os_object_api_version='', os_project_id=None, os_project_name=None, os_volume_api_version='', passcode='', password='***', project_domain_id='', project_domain_name='', project_id='', project_name='admin', protocol='', redirect_uri='', region_name='', timing=False, token='***', trust_id='', url='', user_domain_id='', user_domain_name='', user_id='', username='aspiers', verbose_level=3, verify=None)
Auth plugin password selected
auth_config_hook(): {'key_manager_api_version': 'v1', 'secgroup_source': 'neutron', 'deferred_help': False, 'key': None, 'container_api_version': '1', 'image_api_version': '2', 'disable_vendor_agent': {}, 'cert': None, 'interface': None, 'metering_api_version': '2', 'default_domain': 'default', 'image_api_use_tasks': False, 'debug': True, 'volume_api_version': '2', 'verbose_level': 3, 'message': '', 'floating_ip_source': 'neutron', 'beta_command': False, 'password': '***', 'api_timeout': None, 'username': 'aspiers', 'auth': {'project_name': 'admin'}, 'auth_type': 'password', 'networks': [], 'timing': False, 'object_store_api_version': '1', 'image_format': 'qcow2', 'database_api_version': '1.0', 'region_name': '', 'identity_api_version': '2.0', 'dns_api_version': '2', 'auth_url': 'http://keystone.dev.rc.nectar.org.au:5000/v2.0/', 'cacert': None, 'baremetal_api_version': '1', 'compute_api_version': '2', 'orchestration_api_version': '1', 'network_api_version': '2', 'verify': True, 'status': 'active'}
Deferring keystone exception: argument of type 'OSC_Config' is not iterable
defaults: {'key_manager_api_version': 'v1', 'secgroup_source': 'neutron', 'compute_api_version': '2', 'key': None, 'container_api_version': '1', 'image_api_version': '2', 'disable_vendor_agent': {}, 'cert': None, 'interface': None, 'metering_api_version': '2', 'image_api_use_tasks': False, 'volume_api_version': '2', 'message': '', 'floating_ip_source': 'neutron', 'api_timeout': None, 'auth_type': 'password', 'object_store_api_version': '1', 'image_format': 'qcow2', 'database_api_version': '1.0', 'identity_api_version': '2.0', 'dns_api_version': '2', 'cacert': None, 'baremetal_api_version': '1', 'orchestration_api_version': '1', 'network_api_version': '2', 'verify': True, 'status': 'active'}
cloud cfg: {'key_manager_api_version': 'v1', 'secgroup_source': 'neutron', 'deferred_help': False, 'key': None, 'container_api_version': '1', 'image_api_version': '2', 'disable_vendor_agent': {}, 'cert': None, 'interface': None, 'metering_api_version': '2', 'default_domain': 'default', 'image_api_use_tasks': False, 'debug': True, 'volume_api_version': '2', 'verbose_level': 3, 'message': '', 'floating_ip_source': 'neutron', 'beta_command': False, 'password': '***', 'api_timeout': None, 'username': 'aspiers', 'auth': {'project_name': 'admin', 'auth_url': 'http://keystone.dev.rc.nectar.org.au:5000/v2.0/'}, 'auth_type': 'password', 'networks': [], 'timing': False, 'object_store_api_version': '1', 'image_format': 'qcow2', 'database_api_version': '1.0', 'region_name': '', 'identity_api_version': '2.0', 'dns_api_version': '2', 'auth_url': 'http://keystone.dev.rc.nectar.org.au:5000/v2.0/', 'cacert': None, 'baremetal_api_version': '1', 'compute_api_version': '2', 'orchestration_api_version': '1', 'network_api_version': '2', 'verify': True, 'status': 'active'}
network API version 2, cmd group openstack.network.v2
volume API version 2, cmd group openstack.volume.v2
object_store API version 1, cmd group openstack.object_store.v1
compute API version 2, cmd group openstack.compute.v2
image API version 2, cmd group openstack.image.v2
identity API version 2.0, cmd group openstack.identity.v2
dns API version 2, cmd group openstack.dns.v2
Auth plugin password selected
auth_config_hook(): {'key_manager_api_version': 'v1', 'secgroup_source': 'neutron', 'deferred_help': False, 'key': None, 'container_api_version': '1', 'image_api_version': '2', 'disable_vendor_agent': {}, 'cert': None, 'interface': None, 'metering_api_version': '2', 'default_domain': 'default', 'image_api_use_tasks': False, 'debug': True, 'volume_api_version': '2', 'verbose_level': 3, 'message': '', 'floating_ip_source': 'neutron', 'beta_command': False, 'password': '***', 'api_timeout': None, 'username': 'aspiers', 'auth': {'project_name': 'admin'}, 'auth_type': 'password', 'networks': [], 'timing': False, 'object_store_api_version': '1', 'image_format': 'qcow2', 'database_api_version': '1.0', 'region_name': '', 'identity_api_version': '2.0', 'dns_api_version': '2', 'auth_url': 'http://keystone.dev.rc.nectar.org.au:5000/v2.0/', 'cacert': None, 'baremetal_api_version': '1', 'compute_api_version': '2', 'orchestration_api_version': '1', 'network_api_version': '2', 'verify': True, 'status': 'active'}
Auth plugin password selected
auth_config_hook(): {'key_manager_api_version': 'v1', 'secgroup_source': 'neutron', 'deferred_help': False, 'key': None, 'container_api_version': '1', 'image_api_version': '2', 'disable_vendor_agent': {}, 'cert': None, 'interface': None, 'metering_api_version': '2', 'default_domain': 'default', 'image_api_use_tasks': False, 'debug': True, 'volume_api_version': '2', 'verbose_level': 3, 'message': '', 'floating_ip_source': 'neutron', 'beta_command': False, 'password': '***', 'api_timeout': None, 'username': 'aspiers', 'auth': {'project_name': 'admin'}, 'auth_type': 'password', 'networks': [], 'timing': False, 'object_store_api_version': '1', 'image_format': 'qcow2', 'database_api_version': '1.0', 'region_name': '', 'identity_api_version': '2.0', 'dns_api_version': '2', 'auth_url': 'http://keystone.dev.rc.nectar.org.au:5000/v2.0/', 'cacert': None, 'baremetal_api_version': '1', 'compute_api_version': '2', 'orchestration_api_version': '1', 'network_api_version': '2', 'verify': True, 'status': 'active'}
command: zone list -> designateclient.v2.cli.zones.ListZonesCommand
Using auth plugin: password
Using parameters {'password': '***', 'project_name': 'admin', 'username': 'aspiers', 'auth_url': 'http://keystone.dev.rc.nectar.org.au:5000/v2.0/'}
Get auth_ref
REQ: curl -g -i -X GET http://keystone.dev.rc.nectar.org.au:5000/v2.0/ -H "Accept: application/json" -H "User-Agent: osc-lib keystoneauth1/2.16.0 python-requests/2.12.3 CPython/3.5.2"
Starting new HTTP connection (1): keystone.dev.rc.nectar.org.au
http://keystone.dev.rc.nectar.org.au:5000 "GET /v2.0/ HTTP/1.1" 200 355
RESP: [200] Vary: X-Auth-Token Content-Type: application/json Content-Length: 355 X-Openstack-Request-Id: req-cc307036-4fd9-4af5-a98a-3d265ab7f18b Date: Wed, 07 Dec 2016 03:19:02 GMT Connection: keep-alive
RESP BODY: {"version": {"status": "stable", "updated": "2014-04-17T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v2.0+json"}], "id": "v2.0", "links": [{"href": "http://keystone.dev.rc.nectar.org.au:5000/v2.0/", "rel": "self"}, {"href": "http://docs.openstack.org/", "type": "text/html", "rel": "describedby"}]}}

Making authentication request to http://keystone.dev.rc.nectar.org.au:5000/v2.0/tokens
http://keystone.dev.rc.nectar.org.au:5000 "POST /v2.0/tokens HTTP/1.1" 200 7405
run(Namespace(all_projects=True, columns=[], description=None, edit_managed=False, email=None, formatter='table', max_width=0, name=None, noindent=False, quote_mode='nonnumeric', status=None, sudo_project_id=None, ttl=None, type=None))
Making authentication request to http://keystone.dev.rc.nectar.org.au:5000/v2.0/tokens
http://keystone.dev.rc.nectar.org.au:5000 "POST /v2.0/tokens HTTP/1.1" 200 7405
REQ: curl -g -i -X GET http://designate-m.dev.rc.nectar.org.au:9001/ -H "Accept: application/json" -H "User-Agent: osc-lib keystoneauth1/2.16.0 python-requests/2.12.3 CPython/3.5.2"
Starting new HTTP connection (1): designate-m.dev.rc.nectar.org.au
http://designate-m.dev.rc.nectar.org.au:9001 "GET / HTTP/1.1" 200 479
RESP: [200] Content-Type: application/json Content-Length: 479 Date: Wed, 07 Dec 2016 03:19:03 GMT Connection: keep-alive
RESP BODY: {
  "versions": {
    "values": [
      {
        "id": "v1",
        "links": [
          {
            "href": "http://designate-m.dev.rc.nectar.org.au:9001/v1",
            "rel": "self"
          }
        ],
        "status": "DEPRECATED"
      },
      {
        "id": "v2",
        "links": [
          {
            "href": "http://designate-m.dev.rc.nectar.org.au:9001/v2",
            "rel": "self"
          }
        ],
        "status": "CURRENT"
      }
    ]
  }
}

REQ: curl -g -i -X GET http://designate-m.dev.rc.nectar.org.au:9001/v2/zones? -H "Accept: application/json" -H "X-Auth-Token: {SHA1}7d48b963fa80a819c7f665dbb5f0245053948527" -H "User-Agent: python-designateclient-2.3.0" -H "X-Auth-All-Projects: True" -H "Content-Type: application/json"
Unexpected exception for http://designate-m.dev.rc.nectar.org.au:9001/v2/zones?: Header value True must be of type str or bytes, not <class 'bool'>
Traceback (most recent call last):
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/requests/utils.py", line 792, in check_header_validity
    if not pat.match(value):
TypeError: expected string or bytes-like object

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/keystoneauth1/session.py", line 626, in _send_request
    resp = self.session.request(method, url, **kwargs)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/requests/sessions.py", line 474, in request
    prep = self.prepare_request(req)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/requests/sessions.py", line 407, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/requests/models.py", line 303, in prepare
    self.prepare_headers(headers)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/requests/models.py", line 427, in prepare_headers
    check_header_validity(header)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/requests/utils.py", line 796, in check_header_validity
    "not %s" % (value, type(value)))
requests.exceptions.InvalidHeader: Header value True must be of type str or bytes, not <class 'bool'>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/cliff/app.py", line 400, in run_subcommand
    result = cmd.run(parsed_args)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/osc_lib/command/command.py", line 41, in run
    return super(Command, self).run(parsed_args)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/cliff/display.py", line 112, in run
    column_names, data = self.take_action(parsed_args)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/designateclient/v2/cli/zones.py", line 90, in take_action
    data = get_all(client.zones.list, criterion)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/designateclient/v2/utils.py", line 69, in get_all
    data = function(*args, criterion=criterion)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/designateclient/v2/zones.py", line 48, in list
    return self._get(url, response_key="zones")
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/designateclient/v2/base.py", line 30, in _get
    resp, body = self.client.session.get(url, **kwargs)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/keystoneauth1/adapter.py", line 216, in get
    return self.request(url, 'GET', **kwargs)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/designateclient/v2/client.py", line 79, in request
    response, body = super(self.__class__, self).request(*args, **kwargs)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/keystoneauth1/adapter.py", line 373, in request
    resp = super(LegacyJsonAdapter, self).request(*args, **kwargs)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/keystoneauth1/adapter.py", line 141, in request
    return self.session.request(url, method, **kwargs)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/osc_lib/session.py", line 40, in request
    resp = super(TimingSession, self).request(url, method, **kwargs)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/positional/__init__.py", line 101, in inner
    return wrapped(*args, **kwargs)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/keystoneauth1/session.py", line 592, in request
    resp = send(**kwargs)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/keystoneauth1/session.py", line 646, in _send_request
    raise exceptions.UnknownConnectionError(msg, e)
keystoneauth1.exceptions.connection.UnknownConnectionError: Unexpected exception for http://designate-m.dev.rc.nectar.org.au:9001/v2/zones?: Header value True must be of type str or bytes, not <class 'bool'>
clean_up ListZonesCommand: Unexpected exception for http://designate-m.dev.rc.nectar.org.au:9001/v2/zones?: Header value True must be of type str or bytes, not <class 'bool'>
Traceback (most recent call last):
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/requests/utils.py", line 792, in check_header_validity
    if not pat.match(value):
TypeError: expected string or bytes-like object

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/keystoneauth1/session.py", line 626, in _send_request
    resp = self.session.request(method, url, **kwargs)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/requests/sessions.py", line 474, in request
    prep = self.prepare_request(req)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/requests/sessions.py", line 407, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/requests/models.py", line 303, in prepare
    self.prepare_headers(headers)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/requests/models.py", line 427, in prepare_headers
    check_header_validity(header)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/requests/utils.py", line 796, in check_header_validity
    "not %s" % (value, type(value)))
requests.exceptions.InvalidHeader: Header value True must be of type str or bytes, not <class 'bool'>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/osc_lib/shell.py", line 135, in run
    ret_val = super(OpenStackShell, self).run(argv)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/cliff/app.py", line 279, in run
    result = self.run_subcommand(remainder)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/osc_lib/shell.py", line 180, in run_subcommand
    ret_value = super(OpenStackShell, self).run_subcommand(argv)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/cliff/app.py", line 400, in run_subcommand
    result = cmd.run(parsed_args)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/osc_lib/command/command.py", line 41, in run
    return super(Command, self).run(parsed_args)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/cliff/display.py", line 112, in run
    column_names, data = self.take_action(parsed_args)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/designateclient/v2/cli/zones.py", line 90, in take_action
    data = get_all(client.zones.list, criterion)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/designateclient/v2/utils.py", line 69, in get_all
    data = function(*args, criterion=criterion)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/designateclient/v2/zones.py", line 48, in list
    return self._get(url, response_key="zones")
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/designateclient/v2/base.py", line 30, in _get
    resp, body = self.client.session.get(url, **kwargs)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/keystoneauth1/adapter.py", line 216, in get
    return self.request(url, 'GET', **kwargs)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/designateclient/v2/client.py", line 79, in request
    response, body = super(self.__class__, self).request(*args, **kwargs)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/keystoneauth1/adapter.py", line 373, in request
    resp = super(LegacyJsonAdapter, self).request(*args, **kwargs)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/keystoneauth1/adapter.py", line 141, in request
    return self.session.request(url, method, **kwargs)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/osc_lib/session.py", line 40, in request
    resp = super(TimingSession, self).request(url, method, **kwargs)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/positional/__init__.py", line 101, in inner
    return wrapped(*args, **kwargs)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/keystoneauth1/session.py", line 592, in request
    resp = send(**kwargs)
  File "/home/andrew/.virtualenvs/osc_desig/lib/python3.5/site-packages/keystoneauth1/session.py", line 646, in _send_request
    raise exceptions.UnknownConnectionError(msg, e)
keystoneauth1.exceptions.connection.UnknownConnectionError: Unexpected exception for http://designate-m.dev.rc.nectar.org.au:9001/v2/zones?: Header value True must be of type str or bytes, not <class 'bool'>

END return value: 1

This was under python 3.5.2 in a new virtualenv :

$ pip freeze
appdirs==1.4.0
Babel==2.3.4
cliff==2.3.0
cmd2==0.6.9
debtcollector==1.10.0
iso8601==0.1.11
jsonpatch==1.14
jsonpointer==1.10
jsonschema==2.5.1
keystoneauth1==2.16.0
monotonic==1.2
msgpack-python==0.4.8
netaddr==0.7.18
netifaces==0.10.5
openstacksdk==0.9.10
os-client-config==1.24.0
osc-lib==1.2.0
oslo.config==3.21.0
oslo.i18n==3.11.0
oslo.serialization==2.15.0
oslo.utils==3.20.0
pbr==1.10.0
positional==1.1.1
prettytable==0.7.2
pyparsing==2.1.10
python-cinderclient==1.9.0
python-designateclient==2.3.0
python-glanceclient==2.5.0
python-keystoneclient==3.8.0
python-novaclient==6.0.0
python-openstackclient==3.4.1
pytz==2016.10
PyYAML==3.12
requests==2.12.3
requestsexceptions==1.1.3
rfc3986==0.4.1
simplejson==3.10.0
six==1.10.0
stevedore==1.19.1
warlock==1.2.0
wrapt==1.10.8

Revision history for this message
Andrew Spiers (3-andrew) wrote :

Ok, it looks like the bug was in python-designateclient and has been fixed with
https://review.openstack.org/#/c/390965/

But the latest version of python-designateclient doesn't have this patch in it. Hopefully soon!

Revision history for this message
Steve Martinelli (stevemar) wrote :

Adding designateclient to the bug report since the 'zone' command is theirs. Maybe it'll encourage them to release a new version for you Andrew ;)

Changed in python-openstackclient:
status: New → Invalid
Revision history for this message
Tim Simmons (timsim) wrote :

We'll get a release out soon.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.