Bug 1343583

Summary: Pagination control not supported for listing content hosts in host collection with Satellite 6 command-line
Product: Red Hat Satellite Reporter: Akshay Mankumbare <amankumb>
Component: HammerAssignee: Andrew Kofink <akofink>
Status: CLOSED CURRENTRELEASE QA Contact: Renzo Nuccitelli <rnuccite>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1.8CC: bbuckingham, bkearney, cwelton, mmccune, rnuccite, snag, stbenjam
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: All   
OS: Linux   
URL: http://projects.theforeman.org/issues/15542
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-03 17:08:44 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:

Description Akshay Mankumbare 2016-06-07 13:53:47 UTC
Description of problem:

Pagination control seems to be unsupported for content hosts added in host collection.. 

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

How reproducible:

1. modifying the file '/etc/hammer/cli_config.yaml'
with :per_page: 25

2. Execute command :
host-collection content-hosts --name hostcollection-name --organization ORGNAME

Actual results:

The list for content hosts is restricted to '20' which is default.

Expected results:

It should be restricted to the value defined for parameter 'with :per_page:' in 
'/etc/hammer/cli_config.yaml

Comment 3 Andrew Kofink 2016-06-29 14:08:09 UTC
Created redmine issue http://projects.theforeman.org/issues/15542 from this bug

Comment 4 Andrew Kofink 2016-07-05 19:03:35 UTC
Fixed in 6.2 using the new `hammer host-collection hosts` syntax.

Comment 5 Stephen Benjamin 2016-07-15 13:43:17 UTC
This is officially marked against 6.2.z, so it should not have been switched to ON_QA yet. I guess the best thing to do is move it back to MODIFIED so it gets picked up in the first z-Stream.


---------
I can confirm it works already in 6.2.0 though:

[root@sat-snap-rhel7 ~]# grep per_page /etc/hammer/cli_config.yml 
  :per_page: 1
[root@sat-snap-rhel7 ~]# hammer -u admin -p changeme host-collection hosts --organization-id 1 --name BZ1343583
---|--------------------
ID | NAME               
---|--------------------
5  | centos7.example.com
---|--------------------
Page 1 of 4 (use --page and --per-page for navigation)
[root@sat-snap-rhel7 ~]# hammer -u admin -p changeme host-collection hosts --organization-id 1 --name BZ1343583 --page 2
---|---------------------------
ID | NAME                      
---|---------------------------
1  | sat-snap-rhel7.example.com
---|---------------------------
Page 2 of 4 (use --page and --per-page for navigation)

Comment 6 Brad Buckingham 2016-07-27 17:53:50 UTC
Moving back to ON_QA based on comment 5.

Comment 7 Renzo Nuccitelli 2016-08-02 20:43:43 UTC
I have made an automatic test to check per-page parameter on hammer command overrides global configuration defined on cli_config.yml:

https://github.com/SatelliteQE/robottelo/pull/3680/files#diff-f08885ce2fc39e0b8617a983ead73af7R364


Once it was not viable automating cli_config.yml I at least tested it manually:


------------------------
[root@foo ~]# grep per_page /etc/hammer/cli_config.yml 
  # :per_page: 20

[root@foo ~]# hammer -u admin -p changeme host-collection hosts --organization-id 3 --id 1 
---|----------------
ID | NAME           
---|----------------
2  | bizndtpogcpxiah
3  | wihfxmdfmpzxdjq
---|----------------

[root@foo ~]# hammer -u admin -p changeme host-collection hosts --organization-id 3 --id 1 --per-page 1
---|----------------
ID | NAME           
---|----------------
2  | bizndtpogcpxiah
---|----------------
Page 1 of 2 (use --page and --per-page for navigation)

[root@foo ~]# grep per_page /etc/hammer/cli_config.yml 
  :per_page: 1

[root@foo ~]# hammer -u admin -p changeme host-collection hosts --organization-id 3 --id 1 --per-page 2
---|----------------
ID | NAME           
---|----------------
2  | bizndtpogcpxiah
3  | wihfxmdfmpzxdjq
---|----------------

[root@foo ~]# hammer -u admin -p changeme host-collection hosts --organization-id 3 --id 1 
---|----------------
ID | NAME           
---|----------------
2  | bizndtpogcpxiah
---|----------------
Page 1 of 2 (use --page and --per-page for navigation)

[root@foo ~]# rpm -q satellite
satellite-6.2.0-21.1.el7sat.noarch

---------------------------------

So I am moving this bug to verified

Comment 10 Bryan Kearney 2016-08-03 17:08:44 UTC
This was delivered with Satellite 6.2 which was released on 27 July, 2016.