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.
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)
Created redmine issue https://projects.theforeman.org/issues/25145 from this bug
Upstream bug assigned to stbenjam
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25145 has been resolved.
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.
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