Bug 1241956 - hammer by / order option not working for sorting content-view versions
Summary: hammer by / order option not working for sorting content-view versions
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: 6.1.0
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Katello QA List
URL:
Whiteboard:
: 1255242 (view as bug list)
Depends On:
Blocks: 1482208
TreeView+ depends on / blocked
 
Reported: 2015-07-10 13:44 UTC by Eric Lavarde
Modified: 2023-03-24 13:32 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-21 16:47:02 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Eric Lavarde 2015-07-10 13:44:16 UTC
Description of problem:
Couldn't find any working combination of the --by or --order parameters that would allow me to sort the output.

Version-Release number of selected component (if applicable):
$ rpm -qa | grep hammer
rubygem-hammer_cli_foreman_tasks-0.0.3.4-1.el7sat.noarch
rubygem-hammer_cli_katello-0.0.7.15-1.el7sat.noarch
rubygem-hammer_cli_foreman_bootdisk-0.1.2.7-1.el7sat.noarch
rubygem-hammer_cli-0.1.4.11-1.el7sat.noarch
rubygem-hammer_cli_foreman-0.1.4.14-1.el7sat.noarch
rubygem-hammer_cli_gutterball-0.0.1.2-1.el7sat.noarch
rubygem-hammer_cli_import-0.10.17-1.el7sat.noarch
rubygem-hammer_cli_foreman_discovery-0.0.1.10-1.el7sat.noarch
rubygem-hammer_cli_foreman_docker-0.0.3.7-1.el7sat.noarch


How reproducible:
Always

Steps to Reproduce:
1. Try one of the below tentatives:
$ history | grep 'hammer content-view version list'
[...]
  289  hammer content-view version list --content-view cv-acme-soe-demo --organization Default_Organization --order 'version ASC'
  290  hammer content-view version list --content-view cv-acme-soe-demo --organization Default_Organization --order 'Version ASC'
  291  hammer content-view version list --content-view cv-acme-soe-demo --organization Default_Organization --by version --order ASC
  292  hammer content-view version list --content-view cv-acme-soe-demo --organization Default_Organization --by version
  293  hammer content-view version list --content-view cv-acme-soe-demo --organization Default_Organization --order name DESC
  294  hammer content-view version list --content-view cv-acme-soe-demo --organization Default_Organization --order 'name DESC'
  295  hammer content-view version list --content-view cv-acme-soe-demo --organization Default_Organization --order Name
  296  hammer content-view version list --content-view cv-acme-soe-demo --organization Default_Organization --order DESC

Actual results:
None of them works, --by on its own doesn't seem to make any difference, --order leads always to an error of the kind "the field 'xxx' in the order statement is not valid field for search"

Expected results:
The --help output expects clearly what is expected and how it relates.
There is a clear combination of parameters on how to sort such lists.

Additional info: (debug output of hammer, notice that the order parameter is sent twice, as part of the sort and outside of it, looking at apidoc, it doesn't sound right)

$ hammer --debug --csv content-view version list --content-view cv-acme-soe-demo --organization Default_Organization --by name --order "name ASC"
[ INFO 2015-07-10 14:55:00 Init] Initialization of Hammer CLI (0.1.4.11) has started...
[DEBUG 2015-07-10 14:55:00 Init] Running at ruby 2.0.0-p598
[...]
[ INFO 2015-07-10 14:55:01 API] GET /katello/api/content_views/2/content_view_versions
[DEBUG 2015-07-10 14:55:01 API] Params: {
        "page" => 1,
    "per_page" => 1000,
       "order" => "name ASC",
        "sort" => {
           "by" => "name",
        "order" => "name ASC"
    }
}
[DEBUG 2015-07-10 14:55:01 API] Headers: {
    :params => {
            "page" => 1,
        "per_page" => 1000,
           "order" => "name ASC",
            "sort" => {
               "by" => "name",
            "order" => "name ASC"
        }
    }
}
[DEBUG 2015-07-10 14:55:02 API] 500 Internal Server Error
{
    "displayMessage" => "the field 'name' in the order statement is not valid field for search",
            "errors" => [
        [0] "the field 'name' in the order statement is not valid field for search"
    ]
}
[ERROR 2015-07-10 14:55:02 Exception] the field 'name' in the order statement is not valid field for search
the field 'name' in the order statement is not valid field for search
[ERROR 2015-07-10 14:55:02 Exception] 

RestClient::InternalServerError (500 Internal Server Error):
[...]

Comment 1 RHEL Program Management 2015-07-10 13:55:49 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 4 Bryan Kearney 2016-07-08 20:46:02 UTC
Per 6.3 planning, moving out non acked bugs to the backlog

Comment 6 Bryan Kearney 2017-02-07 18:48:31 UTC
I am seeing this work using a satellite 6.3 client against a satellite 6.2 server. I am marking this as verified for 6.3.

Comment 8 Bryan Kearney 2017-12-11 17:42:10 UTC
*** Bug 1255242 has been marked as a duplicate of this bug. ***

Comment 9 Bryan Kearney 2018-02-21 16:42:51 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, 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-2018:0336

Comment 10 Bryan Kearney 2018-02-21 16:47:02 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, 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-2018:0336

Comment 11 Satellite Program 2018-02-21 16:54:37 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, 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-2018:0336


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