Using the CLI with insufficient privileges results in incorrect error

Bug #1386470 reported by aeva black
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-ironicclient
Fix Released
High
Lucas Alvares Gomes

Bug Description

Demonstrating with current client:

deva@devstack:/opt/stack/python-ironicclient$ export OS_USERNAME=admin
deva@devstack:/opt/stack/python-ironicclient$ ironic node-list
+--------------------------------------+---------------+-------------+--------------------+-------------+
| UUID | Instance UUID | Power State | Provisioning State | Maintenance |
+--------------------------------------+---------------+-------------+--------------------+-------------+
| 669158c7-02d2-4234-803b-5ade8e8b53c8 | None | power off | None | False |
| 7ed0eccc-86bd-44c3-8457-790a848987a6 | None | power off | None | False |
| 172958d9-4e65-480f-af9f-ad67b8dccd0c | None | power off | None | False |
+--------------------------------------+---------------+-------------+--------------------+-------------+

deva@devstack:/opt/stack/python-ironicclient$ export OS_USERNAME=demo
deva@devstack:/opt/stack/python-ironicclient$ ironic node-list
'unicode' object has no attribute 'get'

This was introduced in commit e3d356476be376ebd3dfb3e84f379e113e5efac7

Revision history for this message
aeva black (tenbrae) wrote :
Changed in python-ironicclient:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Lucas Alvares Gomes (lucasagomes) wrote :

Will take a look at it

Changed in python-ironicclient:
assignee: nobody → Lucas Alvares Gomes (lucasagomes)
Revision history for this message
Lucas Alvares Gomes (lucasagomes) wrote :

I did a fresh OS install and run DevStack, but can't reproduce the error:

stack@virtual-machine:~/devstack$ source ~/devstack/accrc/admin/admin
stack@virtual-machine:~/devstack$ ironic node-list
+--------------------------------------+---------------+-------------+--------------------+-------------+
| UUID | Instance UUID | Power State | Provisioning State | Maintenance |
+--------------------------------------+---------------+-------------+--------------------+-------------+
| ffc8f739-9e17-4c71-a975-ff67a1751fdf | None | power off | None | False |
+--------------------------------------+---------------+-------------+--------------------+-------------+

stack@virtual-machine:~/devstack$ export OS_USERNAME=demo
stack@virtual-machine:~/devstack$ ironic node-list
Authentication failure: User f0754e749a38445cbcf00eb6ce7e1655 is unauthorized for tenant b944b45f565d4d26a07dfd478a63f997 (Disable debug mode to suppress these details.) (HTTP 401)
stack@virtual-machine:~/devstack$ export OS_USERNAME=aaaaaaaa
stack@virtual-machine:~/devstack$ ironic node-list
Authentication failure: Could not find user: aaaaaaaa (Disable debug mode to suppress these details.) (HTTP 401)

Revision history for this message
Lucas Alvares Gomes (lucasagomes) wrote :

Oh right, doing a request with a missing parameter (for e.g node-create w/o the driver) and a valid user seems to make the error apparently:

stack@virtual-machine:~/devstack$ source ~/devstack/accrc/admin/admin
stack@virtual-machine:~/devstack$ ironic node-create -i test=test
'unicode' object has no attribute 'get'

Revision history for this message
John Trowbridge (trown) wrote :

I can reproduce Lucas' example. I can't reproduce the issue with node-list.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-ironicclient (master)

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

Changed in python-ironicclient:
status: Confirmed → In Progress
Revision history for this message
Lucas Alvares Gomes (lucasagomes) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-ironicclient (master)

Reviewed: https://review.openstack.org/132033
Committed: https://git.openstack.org/cgit/openstack/python-ironicclient/commit/?id=8d7a2e4f32978b9ef7c33b6703d5bc30f07fa572
Submitter: Jenkins
Branch: master

commit 8d7a2e4f32978b9ef7c33b6703d5bc30f07fa572
Author: Lucas Alvares Gomes <email address hidden>
Date: Thu Oct 30 14:29:58 2014 +0000

    Sync apiclient from Oslo

    Sync'ing apiclient from Oslo to fix the "'unicode' object has no attribute
    'get'" problem.

    Closes-Bug: #1386470
    Change-Id: I46233c04a95c6441ae86572915f4492c6c1a48c5

Changed in python-ironicclient:
status: In Progress → Fix Committed
Changed in python-ironicclient:
milestone: none → 0.7.0
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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