Get a User by Name

Bug #1031245 reported by Peng Yong
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
python-keystoneclient
Invalid
Wishlist
Unassigned
Joseph Heck (heckj)
Changed in python-keystoneclient:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Ken Thomas (krt) wrote :

I'd like to work on this. Anybody mind?

Changed in python-keystoneclient:
assignee: nobody → Ken Thomas (krt)
Revision history for this message
Ken Thomas (krt) wrote :

I've got code that supports the functionality, but I've got a couple of questions.

The spec shows a URI of "v2.0/users​?name=string", but it doesn't say what should happen if the name string is missing. I don't see an exception in keystone/exception that looks applicable. What's the process for creating a new one? Something like ArgumentMissing?

Second, in order to exercise this functionality on the keystone server size, I've got a corresponding change to keystone client. Rather than try to overload 'keystone get-user', is it too awkward to add a 'keystone get-user-by-name <name>'?

Finally, a procedural question. If there's a code change to two different code trees (python-keystoneclient, and keystone), what's the process? Create a branch in each with the same bug and submit them as separate reviews?

Thanks!

Ken

Changed in python-keystoneclient:
status: Triaged → In Progress
Revision history for this message
Adam Young (ayoung) wrote :

If it fails, return the correct HTTP Error:

If they do not put a ? at the end of the request, process as per normal
If they Put ? but no name= value, it should probably also be processed as per normal
If there is ?name= return a 404
If there is ?name=blah and there is no blah in the DB, also return a 404

Change keystone first, and confirm that it has not broken the keystoneclient code, then post the change to keystone client, wonce the approapriate change is accepted in keystone.

I'd prefer not to do get-user-by-name but instead pass a --name parameter

Revision history for this message
Dolph Mathews (dolph) wrote :

It looks like bug 1055763 duplicates this, although they're filed against separate projects. A patch is in review for keystone itself:

Patch: https://review.openstack.org/#/c/14275/

Bug: https://bugs.launchpad.net/keystone/+bug/1055763

Ken: if the query string is not provided, then it's a different call (list users). As for your question on the client side, I share your hesitation (and don't have an answer), but I think we've shot ourselves in the foot by making the <user-id> a positional argument, rather than keystone user-get [--id=<user-id>] [--name=<user-name>]. A fix will have to go into python-openstackclient as well; it's not too late for a more elegant solution there.

Revision history for this message
Ken Thomas (krt) wrote :

Thanks for the feedback. I've added a comment to bug 1055763 to see if Joseph is already working on the client side changes. If so, I figure this issue can safely be marked as a dup.

Revision history for this message
Ken Thomas (krt) wrote :

I heard back about the server side changes that were already being done by bug 1055763 and he's got no plan to do the client side. That makes this a bug a a good place to track the client changes.

Dolph Mathews (dolph)
Changed in python-keystoneclient:
status: In Progress → Fix Released
status: Fix Released → Triaged
importance: High → Wishlist
Revision history for this message
Dolph Mathews (dolph) wrote :

This is effectively superseded by the v3 API which exposes "get by name" via list() calls filtered by "name". Example:

  c.users.list(name='foobar')

This functionality is exposed on the CLI by python-openstackclient.

Changed in python-keystoneclient:
assignee: Ken Thomas (krt) → nobody
status: Triaged → Invalid
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.