Unable to lookup user with just ID

Bug #1597246 reported by Alfredo Moralejo
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
python-openstackclient
Fix Released
High
Steve Martinelli

Bug Description

After https://review.openstack.org/#/c/311206/ , when i try to execute command as admin user:

openstack user show admin --domain default

it fails with error:

No user with a name or ID of '454ad1c743e24edcad846d1118837cac' exists.

454ad1c743e24edcad846d1118837cac is the right id.

It works fine if executing

# openstack user show admin
WARNING: openstackclient.common.utils is deprecated and will be removed after Jun 2017. Please use osc_lib.utils
+-----------+----------------------------------+
| Field | Value |
+-----------+----------------------------------+
| domain_id | default |
| email | root@localhost |
| enabled | True |
| id | 454ad1c743e24edcad846d1118837cac |
| name | admin |
+-----------+----------------------------------+
[root@packstack4 ~(keystone_admin)]#

My findings of this issue:

- in https://github.com/openstack/osc-lib/blob/master/osc_lib/utils.py#L111, get call fails with error:

TypeError: "get() got an unexpected keyword argument 'domain_id'"

- in https://github.com/openstack/osc-lib/blob/master/osc_lib/utils.py#L124 , it's assumed that name_or_id is name, which is incorrect.
- in https://github.com/openstack/osc-lib/blob/master/osc_lib/utils.py#L130 , manager.find returns 404 because it's passing name=454ad1c743e24edcad846d1118837cac which doesn't exist.

Note this is breaking all projects using puppet-keystone as this command is used to check users existence.

Revision history for this message
Steve Martinelli (stevemar) wrote :

See https://review.openstack.org/#/c/335577/ for a patch. We don't have an 'osc-lib' project in launchpad yet.

summary: - User show fails with "--domain default" after
- https://review.openstack.org/#/c/311206/
+ Unable to lookup user with just ID
Changed in python-openstackclient:
importance: Undecided → High
status: New → In Progress
assignee: nobody → Steve Martinelli (stevemar)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to osc-lib (master)

Reviewed: https://review.openstack.org/335577
Committed: https://git.openstack.org/cgit/openstack/osc-lib/commit/?id=7a5987cacf67b9322c13eb346fa9aac35cb5ccf0
Submitter: Jenkins
Branch: master

commit 7a5987cacf67b9322c13eb346fa9aac35cb5ccf0
Author: Steve Martinelli <email address hidden>
Date: Wed Jun 29 09:09:43 2016 -0700

    Attempt to find resource by ID, without kwargs

    In keystone, to look up resources we just need the ID. Supplying
    query arguments in a get() request to the client will result in
    a list being performed. The resulting query will always come up
    with no hits since it'll be trying to find the user "name" even
    if an ID is given.

    Change-Id: I111b2730eefec83968ee89aa4a56cb518ca9b203
    Closes-Bug: #1597246

Changed in python-openstackclient:
status: In Progress → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/osc-lib 0.2.1

This issue was fixed in the openstack/osc-lib 0.2.1 release.

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

Other bug subscribers

Remote bug watches

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