Arguments not initialized if unsupported by keystoneauth plugin

Bug #1744118 reported by Charlie Stocker on 2018-01-18
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-novaclient
Medium
Shilpa Devharakar

Bug Description

Hello,

When using a custom keystoneauth plugin that does not return os_user_id, os_project_domain_id, os_project_domain_name, os_user_domain_id or os_user_domain_name from its get_options() function, python-novaclient will fail with a runtime error when trying to use it.

I believe a good fix would be to amend the _append_global_identity_args functiion in shell.py to add parser.set_defaults() calls for each of the missing arguments.

Error:
(fresh) root@test:~# nova --debug --os-auth-type rackspace_apikey list
DEBUG (shell:793) 'Namespace' object has no attribute 'os_user_id'
Traceback (most recent call last):
  File "/root/virtualenvs/fresh/lib/python3.6/site-packages/novaclient/shell.py", line 791, in main
    OpenStackComputeShell().main(argv)
  File "/root/virtualenvs/fresh/lib/python3.6/site-packages/novaclient/shell.py", line 517, in main
    os_user_id = args.os_user_id
AttributeError: 'Namespace' object has no attribute 'os_user_id'
ERROR (AttributeError): 'Namespace' object has no attribute 'os_user_id'
(fresh) root@test:~# nova --version
10.0.0

information type: Public → Public Security
information type: Public Security → Public
summary: - Arguments not initalized if unsupported by keystoneauth plugin
+ Arguments not initialized if unsupported by keystoneauth plugin
Changed in python-novaclient:
status: New → Confirmed
importance: Undecided → Medium
Changed in python-novaclient:
assignee: nobody → Shilpa Devharakar (shilpasd)

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

Changed in python-novaclient:
assignee: Shilpa Devharakar (shilpasd) → Bhagyashri Shewale (bhagyashri-shewale)
status: Confirmed → In Progress
Changed in python-novaclient:
assignee: Bhagyashri Shewale (bhagyashri-shewale) → Shilpa Devharakar (shilpasd)

Reviewed: https://review.openstack.org/572285
Committed: https://git.openstack.org/cgit/openstack/python-novaclient/commit/?id=ab1f6bd763873863e0b4cd02699f6b46fdbfd85d
Submitter: Zuul
Branch: master

commit ab1f6bd763873863e0b4cd02699f6b46fdbfd85d
Author: shilpa.devharakar <email address hidden>
Date: Wed May 23 12:33:07 2018 +0530

    Modify novaclient to support basic attributes

    Added support for parsing OS_PROJECT_DOMAIN_ID, OS_PROJECT_DOMAIN_NAME,
    OS_USER_DOMAIN_ID, and OS_USER_DOMAIN_NAME options.

    Change-Id: I9e1a3426f174c2e6d9f4f6bf10e9aecb62bad8d0
    Closes-Bug: #1744118

Changed in python-novaclient:
status: In Progress → Fix Released

This issue was fixed in the openstack/python-novaclient 11.0.0 release.

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

Duplicates of this bug

Other bug subscribers