Bug 1649699 - host list --order is a guessing game
Summary: host list --order is a guessing game
Status: POST
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Hammer   
(Show other bugs)
Version: 6.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium vote
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Peter Ondrejka
URL:
Whiteboard:
Keywords: Triaged
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-14 09:29 UTC by Peter Ondrejka
Modified: 2019-01-01 03:05 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
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)


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 11431 None None None 2018-11-15 09:49 UTC

Description Peter Ondrejka 2018-11-14 09:29:18 UTC
Description of problem:
There is no convenient way to tell which keywords will be accepted by 'hammer host list --order' (probably the case of all table ordering in hammer). One would expect the names will somehow resemble the table headers, e.g.: 

 ~]# hammer host list --thin 1
---|--------|------------------|------------|--------------|----------------------
ID | NAME   | OPERATING SYSTEM | HOST GROUP | CONTENT VIEW | LIFECYCLE ENVIRONMENT
...

~]# hammer host list --thin 1 --order 'OPERATING SYSTEM'
400 Bad Request
  the field 'OPERATING' in the order statement is not valid field for search

~]# hammer host list --thin 1 --order 'operating_system'
400 Bad Request
  the field 'operating_system' in the order statement is not valid field for search

[root@smqa-x3550m3-03 ~]# hammer host list --thin 1 --order 'os'
... works

For some fields I'm just unable to find out the keyword or even if they are sortable, for example the host ID, which is ironic as it is mentioned as an example in the 'hammer host list --help':   
--order ORDER  Sort field and order, eg. ‘id DESC’


Version-Release number of selected component (if applicable):
Satellite 6.5 sn 3 but also happens in 6.4


Expected results:
One way to be more helpful here is to provide a list of available keywords in help, or in error message, something like: 
"the field 'OPERATING' in the order statement is not valid field for search (use one of os, ...)"

Comment 2 pm-sat@redhat.com 2018-12-14 11:08:58 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/11431 has been resolved.


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