RDO tickets are now tracked in Jira https://issues.redhat.com/projects/RDO/issues/
Bug 973263 - user-get fails when using IDs which are not UUIDs
Summary: user-get fails when using IDs which are not UUIDs
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RDO
Classification: Community
Component: python-keystoneclient
Version: unspecified
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Jakub Ruzicka
QA Contact: Shai Revivo
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-11 14:58 UTC by Michael Solberg
Modified: 2017-06-18 06:05 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-06-18 06:05:50 UTC
Embargoed:


Attachments (Terms of Use)
Patch will adds a third attempt to resolve the string as a string (488 bytes, patch)
2013-06-11 14:58 UTC, Michael Solberg
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1189933 0 None None None Never

Description Michael Solberg 2013-06-11 14:58:55 UTC
Created attachment 759672 [details]
Patch will adds a third attempt to resolve the string as a string

Description of problem:
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(name_or_id, int) or name_or_id.isdigit():
            return manager.get(int(name_or_id))
    except exceptions.NotFound:
        pass

    # now try to get entity as uuid
    try:
        uuid.UUID(str(name_or_id))
        return manager.get(name_or_id)
    except (ValueError, exceptions.NotFound):
        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 | root.redhat.com |
+------------+--------------------+---------+---------------------------+
[root@virt-three keystone]# keystone user-get rdo-admin
No user with a name or ID of 'rdo-admin' exists.

Version-Release number of selected component (if applicable):
python-keystoneclient-0.2.3-4.el6.noarch

How reproducible:
100%

Steps to Reproduce:
[root@virt-three keystone]# keystone user-list
+------------+--------------------+---------+---------------------------+
| id | name | enabled | email |
+------------+--------------------+---------+---------------------------+
| admin | Administrator | False | |
...
| rdo-admin | RDO Administrator | True | root.redhat.com |
+------------+--------------------+---------+---------------------------+
[root@virt-three keystone]# keystone user-get rdo-admin

Actual results:
No user with a name or ID of 'rdo-admin' exists.

Expected results:
+----------+---------------------------+
| Property |           Value           |
+----------+---------------------------+
|  email   | root.redhat.com |
| enabled  |            True           |
|    id    |         rdo-admin         |
|   name   |     RDO Administrator     |
+----------+---------------------------+


Additional info:
Filed upstream as https://bugs.launchpad.net/python-keystoneclient/+bug/1189933

Comment 1 Adam Young 2013-08-27 20:32:58 UTC
Fix is approved upstream and will be merged shortly.

Comment 2 Jakub Ruzicka 2013-09-03 19:53:33 UTC
Fix has been merged upstream.

Rather than backporting, I'm going to wait for the next keystoneclient release (0.3.2 + 1) and package that one. If that isn't released soon enough, I'm gonna backport anyway.

If you think this is grave enough for immediate fix, please let me know.

Comment 4 Mike McCune 2016-03-28 22:49:28 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 6 Christopher Brown 2017-06-17 19:27:36 UTC
I think this can be closed now? :)


Note You need to log in before you can comment on or make changes to this bug.