osc-lib is not able to validate a none plugin parameters in the CLI

Bug #1724283 reported by Vladyslav Drok
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
keystoneauth
Fix Released
Undecided
Vladyslav Drok
python-openstackclient
Fix Released
Undecided
Vladyslav Drok

Bug Description

When trying to use the none plugin for baremetal commands, the following error appears:

openstack --debug --os-auth-type none --os-endpoint http://192.168.122.22:6385/v1 baremetal node list
....
Auth plugin none selected
auth_config_hook(): {'auth_type': u'none', 'beta_command': False, u'compute_api_version': u'2', u'orchestration_api_version': u'1', u'database_api_version': u'1.0', u'metering_api_version': u'2', u'network_api_version': u'2', u'message': u'', u'image_format': u'qcow2', 'networks': [], u'image_api_version': u'2', 'user_id': u'abc', 'verify': True, u'dns_api_version': u'2', u'object_store_api_version': u'1', u'status': u'active', u'container_infra_api_version': u'1', 'verbose_level': 3, 'region_name': '', 'api_timeout': None, u'baremetal_api_version': '1.9', 'auth': {}, 'default_domain': 'default', u'container_api_version': u'1', u'image_api_use_tasks': False, u'floating_ip_source': u'neutron', 'key': None, 'timing': False, u'application_catalog_api_version': u'1', 'cacert': None, u'key_manager_api_version': u'v1', 'endpoint': u'http://192.168.122.22:6385/v1', u'workflow_api_version': u'2', 'deferred_help': False, u'identity_api_version': u'2.0', u'volume_api_version': u'2', 'cert': None, u'secgroup_source': u'neutron', 'debug': True, u'interface': None, u'disable_vendor_agent': {}}
Missing parameter(s):
Set a cloud-name with --os-cloud or OS_CLOUD
Traceback (most recent call last):
  File "/home/vdrok/client-testing/local/lib/python2.7/site-packages/cliff/app.py", line 393, in run_subcommand
    self.prepare_to_run_command(cmd)
  File "/home/vdrok/client-testing/local/lib/python2.7/site-packages/openstackclient/shell.py", line 200, in prepare_to_run_command
    return super(OpenStackShell, self).prepare_to_run_command(cmd)
  File "/home/vdrok/client-testing/local/lib/python2.7/site-packages/osc_lib/shell.py", line 432, in prepare_to_run_command
    self.client_manager.setup_auth()
  File "/home/vdrok/client-testing/local/lib/python2.7/site-packages/openstackclient/common/clientmanager.py", line 92, in setup_auth
    return super(ClientManager, self).setup_auth()
  File "/home/vdrok/client-testing/local/lib/python2.7/site-packages/osc_lib/clientmanager.py", line 180, in setup_auth
    self.auth_plugin_name,
  File "/home/vdrok/client-testing/local/lib/python2.7/site-packages/osc_lib/api/auth.py", line 131, in check_valid_authentication_options
    _('Missing parameter(s): \n%s') % '\n'.join(msgs)
CommandError: Missing parameter(s):
Set a cloud-name with --os-cloud or OS_CLOUD
clean_up ListBaremetalNode: Missing parameter(s):
Set a cloud-name with --os-cloud or OS_CLOUD
Traceback (most recent call last):
  File "/home/vdrok/client-testing/local/lib/python2.7/site-packages/osc_lib/shell.py", line 134, in run
    ret_val = super(OpenStackShell, self).run(argv)
  File "/home/vdrok/client-testing/local/lib/python2.7/site-packages/cliff/app.py", line 279, in run
    result = self.run_subcommand(remainder)
  File "/home/vdrok/client-testing/local/lib/python2.7/site-packages/osc_lib/shell.py", line 169, in run_subcommand
    ret_value = super(OpenStackShell, self).run_subcommand(argv)
  File "/home/vdrok/client-testing/local/lib/python2.7/site-packages/cliff/app.py", line 393, in run_subcommand
    self.prepare_to_run_command(cmd)
  File "/home/vdrok/client-testing/local/lib/python2.7/site-packages/openstackclient/shell.py", line 200, in prepare_to_run_command
    return super(OpenStackShell, self).prepare_to_run_command(cmd)
  File "/home/vdrok/client-testing/local/lib/python2.7/site-packages/osc_lib/shell.py", line 432, in prepare_to_run_command
    self.client_manager.setup_auth()
  File "/home/vdrok/client-testing/local/lib/python2.7/site-packages/openstackclient/common/clientmanager.py", line 92, in setup_auth
    return super(ClientManager, self).setup_auth()
  File "/home/vdrok/client-testing/local/lib/python2.7/site-packages/osc_lib/clientmanager.py", line 180, in setup_auth
    self.auth_plugin_name,
  File "/home/vdrok/client-testing/local/lib/python2.7/site-packages/osc_lib/api/auth.py", line 131, in check_valid_authentication_options
    _('Missing parameter(s): \n%s') % '\n'.join(msgs)
CommandError: Missing parameter(s):
Set a cloud-name with --os-cloud or OS_CLOUD

This bit of code is the reason -- https://github.com/openstack/osc-lib/blob/45be3e1b2c9c054823e25605d54157d36d875ba0/osc_lib/api/auth.py#L106 and it needs to be fixed.

Vladyslav Drok (vdrok)
Changed in python-openstackclient:
assignee: nobody → Vladyslav Drok (vdrok)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to osc-lib (master)

Fix proposed to branch: master
Review: https://review.openstack.org/512699

Changed in python-openstackclient:
status: New → In Progress
Changed in keystoneauth:
assignee: nobody → Vladyslav Drok (vdrok)
status: New → In Progress
Revision history for this message
Vladyslav Drok (vdrok) wrote :

keystoneauth patch is at https://review.openstack.org/515730

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystoneauth (master)

Reviewed: https://review.openstack.org/515730
Committed: https://git.openstack.org/cgit/openstack/keystoneauth/commit/?id=8e7cfabc273f69c236ebf48c02fcf0b26592f490
Submitter: Zuul
Branch: master

commit 8e7cfabc273f69c236ebf48c02fcf0b26592f490
Author: Vladyslav Drok <email address hidden>
Date: Fri Oct 27 17:44:56 2017 +0300

    Make none auth usable in CLI

    Closes-Bug: #1724283
    Change-Id: I3e477895ba0c989ffd0c91c45791e9f74173a3d6

Changed in keystoneauth:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/keystoneauth 3.4.0

This issue was fixed in the openstack/keystoneauth 3.4.0 release.

Revision history for this message
Mark Goddard (mgoddard) wrote :

As pas-ha suggested, this issue could be related: https://bugs.launchpad.net/bifrost/+bug/1754070.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to osc-lib (master)

Reviewed: https://review.openstack.org/512699
Committed: https://git.openstack.org/cgit/openstack/osc-lib/commit/?id=b764efc46fcee48394761620672a3a1e117aa3db
Submitter: Zuul
Branch: master

commit b764efc46fcee48394761620672a3a1e117aa3db
Author: Vladyslav Drok <email address hidden>
Date: Tue Oct 17 19:21:53 2017 +0300

    Allow to use the none auth plugin

    This change allows to use the none auth plugin in CLI without having
    to specify --os-cloud file with basically a single endpoint parameter.

    Closes-Bug: #1724283
    Depends-On: I3e477895ba0c989ffd0c91c45791e9f74173a3d6
    Depends-On: I3de32193f41d9d1012043b43ae8080f3b1e828e5
    Change-Id: I6cf4e22d676f4a55f84863125aee7318915a7404

Changed in python-openstackclient:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/osc-lib 1.10.0

This issue was fixed in the openstack/osc-lib 1.10.0 release.

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.