Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 973263 - user-get fails when using IDs which are not UUIDs
user-get fails when using IDs which are not UUIDs
Status: CLOSED CURRENTRELEASE
Product: RDO
Classification: Community
Component: python-keystoneclient (Show other bugs)
unspecified
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Jakub Ruzicka
Shai Revivo
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-11 10:58 EDT by Michael Solberg
Modified: 2017-06-18 02:05 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-06-18 02:05:50 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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


External Trackers
Tracker ID Priority Status Summary Last Updated
Launchpad 1189933 None None None Never

  None (edit)
Description Michael Solberg 2013-06-11 10:58:55 EDT
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@atl.salab.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@atl.salab.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@atl.salab.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 16:32:58 EDT
Fix is approved upstream and will be merged shortly.
Comment 2 Jakub Ruzicka 2013-09-03 15:53:33 EDT
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 18:49:28 EDT
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune@redhat.com with any questions
Comment 6 Christopher Brown 2017-06-17 15:27:36 EDT
I think this can be closed now? :)

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