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.

Bug 1654576

Summary: "--order" and "--by" options of "hammer task list" doesn't work as expected.
Product: Red Hat Satellite Reporter: Jameer Pathan <jpathan>
Component: Tasks PluginAssignee: Avi Sharvit <asharvit>
Status: CLOSED ERRATA QA Contact: Jameer Pathan <jpathan>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.5.0CC: apatel, aruzicka, dhlavacd, egolov, inecas, kgaikwad, mbacovsk, mhulan, mshira, rabajaj
Target Milestone: 6.9.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-foreman-tasks-3.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-04-21 13:11:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
output_of_commands none

Description Jameer Pathan 2018-11-29 06:54:28 UTC
Description of problem:
"--order" and "--by" options of "hammer task list" doesn't work as expected.

Version-Release number of selected component (if applicable):
- @satellite 6.5.0 snap 5
- tfm-rubygem-hammer_cli-0.15.1-1.el7sat.noarch

How reproducible:

Steps to Reproduce:
1. hammer> task list --order 'name DESC'
2. hammer> task list --by ACTION

Actual results:
- both the options didn't work as expected.
- They didn't sorted result.

Expected results:
- both the options should work properly.

Additional info:
- attached output of both commands.

Comment 3 Jameer Pathan 2018-11-29 06:55:33 UTC
Created attachment 1509740 [details]
output_of_commands

Comment 5 Adam Ruzicka 2018-12-13 14:38:38 UTC
--order should get fixed when the upstream issue gets merged, but we will most likely still need to do some changes on the hammer-cli-foreman-tasks side

Comment 6 Satellite Program 2018-12-13 15:05:30 UTC
Upstream bug assigned to asharvit

Comment 7 Satellite Program 2018-12-13 15:05:32 UTC
Upstream bug assigned to asharvit

Comment 8 Bryan Kearney 2020-02-18 17:03:45 UTC
Upstream bug assigned to asharvit

Comment 9 Bryan Kearney 2020-02-18 17:03:47 UTC
Upstream bug assigned to asharvit

Comment 10 Bryan Kearney 2020-07-27 12:00:51 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/23938 has been resolved.

Comment 14 Jameer Pathan 2020-12-14 11:55:26 UTC
Verified

Verified with:
- Satellite 6.9.0 snap 5

Test steps:
- hammer> task list --order "action DESC"
- hammer> task list --order action
- hammer> task list --order result
- hammer> task list --order "result ASC"

Observation:
- '--order' and '--by' options are now unified into '--order' which can now accept both "$COLUMN" to sort by and "$COLUMN $DIRECTION" to sort by column in a given direction.

Comment 17 errata-xmlrpc 2021-04-21 13:11:19 UTC
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 (Moderate: Satellite 6.9 Release), 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-2021:1313