osc-lib dependency incorrect

Bug #1687124 reported by Bruno Girin
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-openstackclient
Fix Released
Undecided
Unassigned

Bug Description

Version 3.9.0 of python-openstackclient specifies that it needs osc-lib >= 1.2.0. However, when osc-lib 1.2.0 is installed, the client crashes as a result of an exception thrown when iterating over data returned by osc-lib. Upgrading to a newer version of osc-lib (1.5.1) fixes the problem.

The library dependency should be updated to specify a more recent version of osc-lib that works as expected.

Steps to reproduce:
- install python-openstackclient v3.9.0 (latest released version)
- ensure osc-lib is on version 1.2.0 (lowest acceptable version according to the openstackclient dependencies)
- run any command with the --debug flag

Expected outcome: the command returns the expected data

Actual outcome: the command crashes, see output below

$ openstack --debug server list
START with options: ['--debug', 'server', 'list']
options: Namespace(access_key='', access_secret='***', access_token='***', access_token_endpoint='', access_token_type='', auth_type='', auth_url='https://compute.datacentred.io:5000', cacert=None, cert='', client_id='', client_secret='***', cloud='', code='', consumer_key='', consumer_secret='***', debug=True, default_domain='default', default_domain_id='', default_domain_name='', deferred_help=False, discovery_endpoint='', domain_id='', domain_name='', endpoint='', identity_provider='', identity_provider_url='', insecure=None, interface='', key='', log_file=None, openid_scope='', os_beta_command=False, os_compute_api_version='', os_identity_api_version='3', 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='a1a4dc379a434838a375125a22a727b8', project_name='imbybio_staging', protocol='', redirect_uri='', region_name='sal01', timing=False, token='***', trust_id='', url='', user_domain_id='', user_domain_name='Default', user_id='', <email address hidden>', verbose_level=3, verify=None)
Auth plugin password selected
auth_config_hook(): {'database_api_version': '1.0', 'image_api_version': '2', 'default_domain': 'default', 'metering_api_version': '2', 'container_api_version': '1', 'disable_vendor_agent': {}, 'deferred_help': False, 'image_api_use_tasks': False, 'timing': False, 'api_timeout': None, 'cert': None, 'dns_api_version': '2', 'key_manager_api_version': 'v1', 'password': '***', 'username': '<email address hidden>', 'secgroup_source': 'neutron', 'interface': None, 'beta_command': False, 'auth': {'user_domain_name': 'Default', 'project_name': 'imbybio_staging', 'project_id': 'a1a4dc379a434838a375125a22a727b8', 'project_domain_id': 'default'}, 'auth_url': 'https://compute.datacentred.io:5000', 'orchestration_api_version': '1', 'object_store_api_version': '1', 'status': 'active', 'region_name': 'sal01', 'image_format': 'qcow2', 'debug': True, 'baremetal_api_version': '1', 'verify': True, 'network_api_version': '2', 'message': '', 'cacert': None, 'compute_api_version': '2', 'identity_api_version': '3', 'verbose_level': 3, 'networks': [], 'volume_api_version': '2', 'floating_ip_source': 'neutron', 'key': None, 'auth_type': 'password'}
Deferring keystone exception: argument of type 'OSC_Config' is not iterable
defaults: {'database_api_version': '1.0', 'image_api_version': '2', 'metering_api_version': '2', 'dns_api_version': '2', 'disable_vendor_agent': {}, 'image_api_use_tasks': False, 'cert': None, 'container_api_version': '1', 'key_manager_api_version': 'v1', 'secgroup_source': 'neutron', 'interface': None, 'api_timeout': None, 'orchestration_api_version': '1', 'object_store_api_version': '1', 'status': 'active', 'image_format': 'qcow2', 'baremetal_api_version': '1', 'verify': True, 'network_api_version': '2', 'message': '', 'cacert': None, 'compute_api_version': '2', 'identity_api_version': '2.0', 'volume_api_version': '2', 'floating_ip_source': 'neutron', 'key': None, 'auth_type': 'password'}
cloud cfg: {'database_api_version': '1.0', 'network_api_version': '2', 'image_api_version': '2', 'metering_api_version': '2', 'container_api_version': '1', 'disable_vendor_agent': {}, 'deferred_help': False, 'image_api_use_tasks': False, 'timing': False, 'api_timeout': None, 'cert': None, 'dns_api_version': '2', 'key_manager_api_version': 'v1', 'username': '<email address hidden>', 'secgroup_source': 'neutron', 'interface': None, 'beta_command': False, 'auth': {'user_domain_name': 'Default', 'project_name': 'imbybio_staging', 'auth_url': 'https://compute.datacentred.io:5000', 'project_id': 'a1a4dc379a434838a375125a22a727b8', 'project_domain_id': 'default'}, 'message': '', 'auth_url': 'https://compute.datacentred.io:5000', 'orchestration_api_version': '1', 'object_store_api_version': '1', 'status': 'active', 'region_name': 'sal01', 'image_format': 'qcow2', 'debug': True, 'baremetal_api_version': '1', 'verify': True, 'default_domain': 'default', 'password': '***', 'cacert': None, 'compute_api_version': '2', 'identity_api_version': '3', 'verbose_level': 3, 'networks': [], 'volume_api_version': '2', 'floating_ip_source': 'neutron', 'key': None, 'auth_type': 'password'}
volume API version 2, cmd group openstack.volume.v2
network API version 2, cmd group openstack.network.v2
compute API version 2, cmd group openstack.compute.v2
object_store API version 1, cmd group openstack.object_store.v1
image API version 2, cmd group openstack.image.v2
identity API version 3, cmd group openstack.identity.v3
Auth plugin password selected
auth_config_hook(): {'database_api_version': '1.0', 'image_api_version': '2', 'default_domain': 'default', 'metering_api_version': '2', 'container_api_version': '1', 'disable_vendor_agent': {}, 'deferred_help': False, 'image_api_use_tasks': False, 'timing': False, 'api_timeout': None, 'cert': None, 'dns_api_version': '2', 'key_manager_api_version': 'v1', 'password': '***', 'username': '<email address hidden>', 'secgroup_source': 'neutron', 'interface': None, 'beta_command': False, 'auth': {'user_domain_name': 'Default', 'project_name': 'imbybio_staging', 'project_id': 'a1a4dc379a434838a375125a22a727b8', 'project_domain_id': 'default'}, 'auth_url': 'https://compute.datacentred.io:5000', 'orchestration_api_version': '1', 'object_store_api_version': '1', 'status': 'active', 'region_name': 'sal01', 'image_format': 'qcow2', 'debug': True, 'baremetal_api_version': '1', 'verify': True, 'network_api_version': '2', 'message': '', 'cacert': None, 'compute_api_version': '2', 'identity_api_version': '3', 'verbose_level': 3, 'networks': [], 'volume_api_version': '2', 'floating_ip_source': 'neutron', 'key': None, 'auth_type': 'password'}
Auth plugin password selected
auth_config_hook(): {'database_api_version': '1.0', 'image_api_version': '2', 'default_domain': 'default', 'metering_api_version': '2', 'container_api_version': '1', 'disable_vendor_agent': {}, 'deferred_help': False, 'image_api_use_tasks': False, 'timing': False, 'api_timeout': None, 'cert': None, 'dns_api_version': '2', 'key_manager_api_version': 'v1', 'password': '***', 'username': '<email address hidden>', 'secgroup_source': 'neutron', 'interface': None, 'beta_command': False, 'auth': {'user_domain_name': 'Default', 'project_name': 'imbybio_staging', 'project_id': 'a1a4dc379a434838a375125a22a727b8', 'project_domain_id': 'default'}, 'auth_url': 'https://compute.datacentred.io:5000', 'orchestration_api_version': '1', 'object_store_api_version': '1', 'status': 'active', 'region_name': 'sal01', 'image_format': 'qcow2', 'debug': True, 'baremetal_api_version': '1', 'verify': True, 'network_api_version': '2', 'message': '', 'cacert': None, 'compute_api_version': '2', 'identity_api_version': '3', 'verbose_level': 3, 'networks': [], 'volume_api_version': '2', 'floating_ip_source': 'neutron', 'key': None, 'auth_type': 'password'}
Deferring keystone exception: argument of type 'OSC_Config' is not iterable
command: server list -> openstackclient.compute.v2.server.ListServer
'token'
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/openstackclient/common/clientmanager.py", line 81, in setup_auth
    self._cli_options.config,
  File "/usr/local/lib/python3.5/dist-packages/openstackclient/common/client_config.py", line 69, in load_auth_plugin
    config = self._validate_auth(config, loader)
  File "/usr/local/lib/python3.5/dist-packages/osc_lib/cli/client_config.py", line 225, in _validate_auth
    if 'option_prompt' in self:
TypeError: argument of type 'OSC_Config' is not iterable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/cliff/app.py", line 393, in run_subcommand
    self.prepare_to_run_command(cmd)
  File "/usr/local/lib/python3.5/dist-packages/openstackclient/shell.py", line 200, in prepare_to_run_command
    return super(OpenStackShell, self).prepare_to_run_command(cmd)
  File "/usr/local/lib/python3.5/dist-packages/osc_lib/shell.py", line 429, in prepare_to_run_command
    self.client_manager.setup_auth()
  File "/usr/local/lib/python3.5/dist-packages/openstackclient/common/clientmanager.py", line 84, in setup_auth
    self._fallback_load_auth_plugin(e)
  File "/usr/local/lib/python3.5/dist-packages/openstackclient/common/clientmanager.py", line 93, in _fallback_load_auth_plugin
    if self._cli_options.config['auth']['token'] == 'x':
KeyError: 'token'
clean_up ListServer: 'token'
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/openstackclient/common/clientmanager.py", line 81, in setup_auth
    self._cli_options.config,
  File "/usr/local/lib/python3.5/dist-packages/openstackclient/common/client_config.py", line 69, in load_auth_plugin
    config = self._validate_auth(config, loader)
  File "/usr/local/lib/python3.5/dist-packages/osc_lib/cli/client_config.py", line 225, in _validate_auth
    if 'option_prompt' in self:
TypeError: argument of type 'OSC_Config' is not iterable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/osc_lib/shell.py", line 135, in run
    ret_val = super(OpenStackShell, self).run(argv)
  File "/usr/local/lib/python3.5/dist-packages/cliff/app.py", line 279, in run
    result = self.run_subcommand(remainder)
  File "/usr/local/lib/python3.5/dist-packages/osc_lib/shell.py", line 180, in run_subcommand
    ret_value = super(OpenStackShell, self).run_subcommand(argv)
  File "/usr/local/lib/python3.5/dist-packages/cliff/app.py", line 393, in run_subcommand
    self.prepare_to_run_command(cmd)
  File "/usr/local/lib/python3.5/dist-packages/openstackclient/shell.py", line 200, in prepare_to_run_command
    return super(OpenStackShell, self).prepare_to_run_command(cmd)
  File "/usr/local/lib/python3.5/dist-packages/osc_lib/shell.py", line 429, in prepare_to_run_command
    self.client_manager.setup_auth()
  File "/usr/local/lib/python3.5/dist-packages/openstackclient/common/clientmanager.py", line 84, in setup_auth
    self._fallback_load_auth_plugin(e)
  File "/usr/local/lib/python3.5/dist-packages/openstackclient/common/clientmanager.py", line 93, in _fallback_load_auth_plugin
    if self._cli_options.config['auth']['token'] == 'x':
KeyError: 'token'

END return value: 1

Revision history for this message
David Rabel (rabel-b1) wrote :

In that constellation I have the same error:

$openstack server list
argument of type 'OSC_Config' is not iterable

Changed in python-openstackclient:
status: New → Confirmed
Revision history for this message
David Rabel (rabel-b1) wrote :

I am not sure about bugfixes on OSC in versions between the major OpenStack releases, though.

That is I only find git branches for the major OpenStack releases and since 3.9.0 is just an intermediate version on the way to Pike, there will probably not be a 3.9.1 or similar to fix this issue.

It is fixed in the currenct release though.

Revision history for this message
David Rabel (rabel-b1) wrote :

Fixed in git commit I5215bae5234dcef448c6c5b824c506f80dd1c5a8

Changed in python-openstackclient:
status: Confirmed → Fix Released
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.