Bug 1624416 - Hammer command with content view version --order is not working as expected.
Summary: Hammer command with content view version --order is not working as expected.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Hammer - Content
Version: 6.3.2
Hardware: All
OS: Linux
high
medium vote
Target Milestone: Released
Assignee: Stephen Benjamin
QA Contact: Jameer Pathan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-08-31 13:56 UTC by Varatharaja Perumal G
Modified: 2019-10-07 17:37 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-14 12:37:51 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2019:1222 None None None 2019-05-14 12:38:03 UTC
Foreman Issue Tracker 25145 None None None 2018-10-08 17:15:18 UTC

Description Varatharaja Perumal G 2018-08-31 13:56:22 UTC
Description of problem:

After upgrading Satellite 6.2 to 6.3 hammer content view version --order parameter not functioning as expected.

Version-Release number of selected component (if applicable):

tfm-rubygem-hammer_cli-0.11.0.1-1.el7sat.noarch

How reproducible:

Steps to Reproduce:

1. Publish multiple version of a content view.

2. Run # hammer  --output csv content-view version list --content-view client --organization redhat --order 'version DESC'


Actual results:

# hammer  --output csv content-view version list --content-view client --organization redhat --order 'version DESC'
ID,Name,Version,Lifecycle Environments

Expected results:

# hammer  --output csv content-view version list --content-view client --organization redhat --order 'version DESC'
ID,Name,Version,Lifecycle Environments
4,client 2.0,2.0,Library
3,client 1.0,1.0,"Dev, Prod"

Additional info:

This parameter is working well in Satellite 6.2.

Comment 2 Brad Buckingham 2018-09-06 20:59:06 UTC
I was able to reproduce this behavior on 6.4, but not 6.2 as reported.

Example from 6.2:
-----------------

hammer> content-view version list --content-view RHEL6 --organization "Reference Satellite" --order 'version ASC'
---|-----------|---------|-----------------------
ID | NAME      | VERSION | LIFECYCLE ENVIRONMENTS
---|-----------|---------|-----------------------
4  | RHEL6 2.0 | 2.0     |                       
6  | RHEL6 3.0 | 3.0     | Library, Capsule_Sync 
---|-----------|---------|-----------------------

production.log:

2018-09-06 16:52:09 3f7f7c40 [app] [I] Processing by Katello::Api::V2::ContentViewsController#index as JSON
2018-09-06 16:52:09 3f7f7c40 [app] [I]   Parameters: {"name"=>"RHEL6", "api_version"=>"v2", "organization_id"=>"1", "content_view"=>{}}
2018-09-06 16:52:09 3f7f7c40 [app] [I] Authorized user admin(Admin User)
2018-09-06 16:52:09 3f7f7c40 [app] [I]   Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.170/app/views/katello/api/v2/content_views/index.json.rabl within katello/api/v2/layouts/collection (98.5ms)
2018-09-06 16:52:09 3f7f7c40 [app] [I] Completed 200 OK in 174ms (Views: 90.2ms | ActiveRecord: 26.3ms)
2018-09-06 16:52:09 2546c5eb [app] [I] Started GET "/katello/api/content_views/3/content_view_versions?page=1&per_page=1000&order=version+ASC&sort=%7B%22order%22%3D%3E%22version+ASC%22%7D" for 127.0.0.1 at 2018-09-06 16:52:09 -0400
2018-09-06 16:52:09 2546c5eb [app] [I] Processing by Katello::Api::V2::ContentViewVersionsController#index as JSON
2018-09-06 16:52:09 2546c5eb [app] [I]   Parameters: {"page"=>"1", "per_page"=>"1000", "order"=>"version ASC", "sort"=>"{\"order\"=>\"version ASC\"}", "api_version"=>"v2", "content_view_id"=>"3", "content_view_version"=>{}}
2018-09-06 16:52:09 2546c5eb [app] [I] Authorized user admin(Admin User)
2018-09-06 16:52:10 2546c5eb [app] [I]   Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.170/app/views/katello/api/v2/content_view_versions/index.json.rabl within katello/api/v2/layouts/collection (1046.8ms)
2018-09-06 16:52:10 2546c5eb [app] [I] Completed 200 OK in 1121ms (Views: 550.2ms | ActiveRecord: 514.9ms)


Example from 6.4:  
-----------------

hammer> content-view version list --content-view "composite with versions" --organization "Default Organization" --order 'version DESC'
---|------|---------|-----------------------
ID | NAME | VERSION | LIFECYCLE ENVIRONMENTS
---|------|---------|-----------------------

(NOTE: there should be 2 versions returned).

production.log:

(note: no error in production.log, but format "order" parameter is different than on the earlier release.)

2018-09-06T16:55:07 [I|app|] Started GET "/katello/api/content_views/5/content_view_versions?organization_id=1&page=1&per_page=1000&order=version+DESC&sort[order]=version+DESC" for 10.8.0.142 at 2018-09-06 16:55:07 -0400
2018-09-06T16:55:07 [I|app|29622] Processing by Katello::Api::V2::ContentViewVersionsController#index as JSON
2018-09-06T16:55:07 [I|app|29622]   Parameters: {"organization_id"=>"1", "page"=>"1", "per_page"=>"1000", "order"=>"version DESC", "sort"=>{"order"=>"version DESC"}, "api_version"=>"v2", "content_view_id"=>"5", "content_view_version"=>{}}
2018-09-06T16:55:07 [I|app|29622] Current user: foreman_admin (administrator)
2018-09-06T16:55:07 [I|app|29622] Authorized user admin(Admin User)
2018-09-06T16:55:07 [I|app|29622] Current user: admin (administrator)
2018-09-06T16:55:07 [I|app|29622]   Rendering /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.22/app/views/katello/api/v2/content_view_versions/index.json.rabl within katello/api/v2/layouts/collection
2018-09-06T16:55:07 [I|app|29622]   Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.22/app/views/katello/api/v2/content_view_versions/index.json.rabl within katello/api/v2/layouts/collection (0.8ms)
2018-09-06T16:55:07 [I|app|29622] Completed 200 OK in 35ms (Views: 1.4ms | ActiveRecord: 21.0ms)

Comment 5 Stephen Benjamin 2018-10-08 17:15:17 UTC
Created redmine issue https://projects.theforeman.org/issues/25145 from this bug

Comment 6 pm-sat@redhat.com 2018-10-08 18:05:38 UTC
Upstream bug assigned to stbenjam@redhat.com

Comment 7 pm-sat@redhat.com 2018-10-08 18:05:41 UTC
Upstream bug assigned to stbenjam@redhat.com

Comment 8 pm-sat@redhat.com 2018-10-12 12:05:37 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25145 has been resolved.

Comment 10 Jameer Pathan 2018-11-21 13:14:13 UTC
verified 

@satellite 6.5.0 snap 4

steps:
1. Publish multiple version of a content view.
2. hammer> content-view version list --content-view zoo1 --organization-id 1 --order "version DESC"
---|----------|---------|-----------------------
ID | NAME     | VERSION | LIFECYCLE ENVIRONMENTS
---|----------|---------|-----------------------
14 | zoo1 3.0 | 3.0     | Library               
13 | zoo1 2.0 | 2.0     | DEV                   
12 | zoo1 1.0 | 1.0     |                       
---|----------|---------|-----------------------

observation:
Hammer command with content view version --order is working as expected.

Comment 12 errata-xmlrpc 2019-05-14 12:37: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-2019:1222


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