user-get fails when using IDs which are not UUIDs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-keystoneclient |
Fix Released
|
High
|
Adam Young |
Bug Description
When resolving the user positional argument to the "user-get" command, keystoneclient uses the following logic:
# first try to get entity as integer id
try:
if isinstance(
return manager.
except exceptions.
pass
# now try to get entity as uuid
try:
return manager.
except (ValueError, exceptions.
pass
When using a readonly LDAP server as the identity store, userids are strings instead of integers or UUIDs. Thus user lookups fail with a exceptions.NotFound exception.
[root@virt-three keystone]# keystone user-list
+------
| id | name | enabled | email |
+------
| admin | Administrator | False | |
...
| rdo-admin | RDO Administrator | True | <email address hidden> |
+------
[root@virt-three keystone]# keystone user-get rdo-admin
No user with a name or ID of 'rdo-admin' exists.
The attached patch resolves this issue by adding a third search attempt with the userid cast as a string:
[root@virt-three keystone]# keystone user-get rdo-admin
+------
| Property | Value |
+------
| email | <email address hidden> |
| enabled | True |
| id | rdo-admin |
| name | RDO Administrator |
+------
Changed in python-keystoneclient: | |
assignee: | Michael Solberg (msolberg) → Adam Young (ayoung) |
Changed in python-keystoneclient: | |
assignee: | Adam Young (ayoung) → Michael Solberg (msolberg) |
Changed in python-keystoneclient: | |
milestone: | none → 0.4.0 |
Changed in python-keystoneclient: | |
status: | Fix Committed → Fix Released |
Any chance you can put that patch up for review on gerrit?