Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
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 2Satellite Program
2018-12-14 11:08:58 UTC
I checked with Satellite 6.6 snap 6, the `Search fields` section has been added to the output of `hammer host list -h` and also to the help of list commands for other entities, but at many places it is still missing (organization, location, product, job template, etc.). It is not clear why this pattern emerges.
Also I would change the help for the --order subcommand to refer to the search fields, something like:
--order ORDER Sort field and order, eg. ‘name DESC’. See "Search fields" below for the list of valid fields
It's not a Hammer issue anymore, since Hammer relies on the API documentation provided by the server, which apparently lacks some documented resources and thus should be updated. I've created an upstream issue: https://projects.theforeman.org/issues/27098
Comment #3 is greatly expanding the scope of this bugzilla beyond just 'hammer host list' Can we verify this for *just* the host list and file new bugs for comprehensive update for other commands?
Going to move this back ON_QA for verification that you can order by the "Search fields:" in the host list which appeared to work for me
Hi Mike, the fix also spans beyond 'hammer host list'. I understand the request, though filing bugs separately per subcommand sounds like an overhead, so I suggest just one bug for covering the subcommands that were omitted here.
Verified on Satellite 6.6 snap 20. Host list in help shows possible arguments for search and order. Creating another bug for other commands as requested.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHSA-2019:3172