Bug 1317677

Summary: New hammer host-collection hosts command does not expose any options
Product: Red Hat Satellite Reporter: Og Maciel <omaciel>
Component: HammerAssignee: Walden Raines <walden>
Status: CLOSED ERRATA QA Contact: Sanket Jagtap <sjagtap>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: akofink, bbuckingham, dnagarat, kbidarka, oshtaier
Target Milestone: UnspecifiedKeywords: PrioBumpQA, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/15429
Whiteboard:
Fixed In Version: rubygem-hammer_cli_katello-0.0.22.16-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-27 11:05:28 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 Og Maciel 2016-03-14 20:36:21 UTC
Description of problem:

I noticed that the command hammer host-collection hosts does not expose any options:

hammer> host-collection hosts -h
Usage:
     host-collection hosts [OPTIONS]

Options:
 -h, --help                    print help

Furthermore, running the command itself fails:

hammer> host-collection hosts
Error: The server does not support such operation.


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

* Satellite 6.2.0 SNAP 3.1

How reproducible:


Steps to Reproduce:
1. Use the command host-collection hosts
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Brad Buckingham 2016-06-07 10:03:33 UTC
*** Bug 1335295 has been marked as a duplicate of this bug. ***

Comment 3 Oleksandr Shtaier 2016-06-14 07:32:54 UTC
It doesn't seem that we have any other way to get list of hosts inside of host collection, so that defect seems as more urgent thing. Personally, I don't see much sense in adding or removing something from collection if I can't get the actual list of content for that collection. The info command provide us only the amount of hosts which doesn't seem as enough level of details. For example:

>hammer -v -u admin -p changeme  host-collection info --id="69" --organization-id="1698"
ID:          69
Name:        vZijPChoMPABDki
Limit:       None
Description: 
Total Hosts: 1

If there is any alternative, so please return defect into previous state

Comment 4 Walden Raines 2016-06-15 20:55:28 UTC
Created redmine issue http://projects.theforeman.org/issues/15429 from this bug

Comment 5 Walden Raines 2016-06-15 21:20:37 UTC
PR: https://github.com/Katello/hammer-cli-katello/pull/410

Comment 6 Walden Raines 2016-06-17 20:21:16 UTC
Revision 8a8057e2
Added by Walden Raines 25 minutes ago

Fixes #15429: use host API for host collection hosts. (#410)

The host collection hosts command was pointing at an API that had been
removed. This change brings the command in line with the API.

http://projects.theforeman.org/issues/15429

Comment 7 Oleksandr Shtaier 2016-06-22 09:02:29 UTC
Verified on 6.2 SNAP17

hammer host-collection hosts --help
Usage:
    hammer host-collection hosts [OPTIONS]

Options:
 --environment ENVIRONMENT_NAME          Name to search by
 --environment-id ENVIRONMENT_ID          
 --hostgroup HOSTGROUP_NAME              Name to search by
 --hostgroup-id HOSTGROUP_ID              
 --id HOST_COLLECTION_ID                 Host Collection ID
 --location LOCATION_NAME                Name to search by
 --location-id LOCATION_ID                
 --name HOST_COLLECTION_NAME             Host Collection Name
 --order ORDER                           sort results
 --organization ORGANIZATION_NAME        Organization name to search by
 --organization-id ORGANIZATION_ID       organization ID
 --organization-label ORGANIZATION_LABEL Organization label to search by
 --page PAGE                             paginate results
 --per-page PER_PAGE                     number of entries per request
 --search SEARCH                         filter results
 -h, --help                              print help


>hammer -v -u admin -p changeme  host-collection info --id="74" --organization-id="1765"

ID:          74
Name:        DbybbcUiVLXgmIf
Limit:       None
Description: 
Total Hosts: 1

>hammer -v -u admin -p changeme --output=csv host-collection hosts --name="DbybbcUiVLXgmIf" --organization-id="1765"

ID,Name
291,emjnsrszgsvylmw

Comment 8 Sanket Jagtap 2016-06-22 13:31:32 UTC
Build : Satellite 6.2 Snap 17

 host-collection hosts --help
Usage:
     host-collection hosts [OPTIONS]

Options:
 --environment ENVIRONMENT_NAME          Name to search by
 --environment-id ENVIRONMENT_ID          
 --hostgroup HOSTGROUP_NAME              Name to search by
 --hostgroup-id HOSTGROUP_ID              
 --id HOST_COLLECTION_ID                 Host Collection ID
 --location LOCATION_NAME                Name to search by
 --location-id LOCATION_ID                
 --name HOST_COLLECTION_NAME             Host Collection Name
 --order ORDER                           sort results
 --organization ORGANIZATION_NAME        Organization name to search by
 --organization-id ORGANIZATION_ID       organization ID
 --organization-label ORGANIZATION_LABEL Organization label to search by
 --page PAGE                             paginate results
 --per-page PER_PAGE                     number of entries per request
 --search SEARCH                         filter results
 -h, --help                              print help

Comment 9 Walden Raines 2016-06-22 22:20:49 UTC
*** Bug 1348340 has been marked as a duplicate of this bug. ***

Comment 10 Bryan Kearney 2016-07-27 11:05:28 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/RHBA-2016:1501