Project

General

Profile

Bug #4489

hammer user list --search only works for login

Added by Og Maciel over 8 years ago. Updated over 8 years ago.

Status:
Feedback
Priority:
Normal
Assignee:
-
Category:
Search
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:

Description

Should I be able to search for users by any other field other than login?

# hammer user list --search 'user'
--------------------------------------------------
ID | LOGIN  | NAME       | EMAIL
--------------------------------------------------
1  | admin  | Admin User | root@usersys.redhat.com
3  | user1  |            | user@example.com
4  | user11 |            | user@example.com
5  | user2  |            | user@example.com
--------------------------------------------------

[root@qetello01 ~]# hammer user list --search 'id=3'
Error: 400 Bad Request
[root@qetello01 ~]# hammer user list --search id=3
Error: 400 Bad Request
[root@qetello01 ~]# hammer user list --search email=user@example.com
Error: 400 Bad Request
[root@qetello01 ~]# hammer user list --search 'email=user@example.com'
Error: 400 Bad Request
[root@qetello01 ~]# hammer user list --search name=user1
Error: 400 Bad Request
[root@qetello01 ~]# hammer user list --search login=user1
------------------------------------
ID | LOGIN | NAME | EMAIL
------------------------------------
3  | user1 |      | user@example.com
------------------------------------
[root@qetello01 ~]# hammer user list --search login=user123
No data.
[root@qetello01 ~]# hammer user list --search name='Admin User'
Error: 400 Bad Request

History

#1 Updated by Dominic Cleal over 8 years ago

  • Status changed from New to Need more information

Can you provide production.log from these requests? 400 bad request is a server-side error, so it's an API bug.

#2 Updated by Og Maciel over 8 years ago

  • Status changed from Need more information to Feedback

Uploaded logs via built in rsync process: /tmp/foreman-debug-VXXbW.tar.xz

#3 Updated by Og Maciel over 8 years ago

Newer logs found at /tmp/foreman-debug-R98fu.tar.xz

#4 Updated by Dominic Cleal over 8 years ago

  • Project changed from Hammer CLI to Foreman
  • Category changed from Hammer core to Search

Ok, I see the issue. The fields available for searching users are:

  • login
  • firstname
  • lastname
  • mail (not email)
  • admin
  • last_login_on
  • roles, usergroups

Also available in: Atom PDF