Bug 1503586

Summary: Remove --include and --thin options
Product: Red Hat Satellite Reporter: Stanislav Tkachenko <stkachen>
Component: Hammer - ContentAssignee: Kavita <kgaikwad>
Status: CLOSED ERRATA QA Contact: Peter Ondrejka <pondrejk>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: bbuckingham, ehelms, jcallaha, tstrachota
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1505305 (view as bug list) Environment:
Last Closed: 2018-02-21 16:54:17 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:
Bug Depends On:    
Bug Blocks: 1505305    

Description Stanislav Tkachenko 2017-10-18 12:35:52 UTC
Description of problem:
According to [1] new parameters (include and thin) were added to API and hammer automatically generates options for that parameters but it has no effect in the cli.

It is already fixed in [2]

Since the fix is trivial and those options were not present in previous releases I'd vote for cherry-pick into 6.3 and to not expose useless options in new release.

[1] http://projects.theforeman.org/issues/20754
[2] https://github.com/theforeman/hammer-cli-foreman/pull/331

Version-Release number of selected component (if applicable):
Satellite 6.3 Snap 20:
* tfm-rubygem-hammer_cli-0.11.0.1-1.el7sat.noarch
* foreman-1.15.4.8-1.el7sat.noarch
* katello-3.4.5-4.el7sat.noarch
* satellite-6.3.0-20.0.beta.el7sat.noarch

How reproducible:
Always

Steps to Reproduce:
1. hammer host list --help
2. hammer hostgroup list --help
3.

Actual results:
--thin and --include options are present

Expected results:
Those options should not be present

Additional info:

Comment 2 Satellite Program 2017-10-18 14:04:24 UTC
Upstream bug assigned to kgaikwad

Comment 3 Satellite Program 2017-10-18 14:04:26 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/20754 has been resolved.

Comment 4 jcallaha 2017-10-20 15:11:29 UTC
I would like to see the host list --thin actually implemented, as how the API provides it. However, I agree that the hostgroup doesn't need a --thin option.

Comment 5 Brad Buckingham 2017-10-20 18:54:32 UTC
Stanislav,

Based on Jake's feedback in comment 4, should we open a separate bug to later  re-introduce support for --thin for the 'host list' command?  The alternative, if that is the desired outcome, is that the upstream fix may need to be changed.

Comment 6 Stanislav Tkachenko 2017-10-23 09:26:36 UTC
(In reply to Brad Buckingham from comment #5)

Personally I'd vote for the first option. So I'd humbly ask Jake to create that RFE as he better understand what should be added :)

Comment 7 jcallaha 2017-10-23 16:01:01 UTC
It looks like the host list --thin option already works in 6.3. On this system, a host list without --think takes 4m30.936s since it has 5012 hosts. Below are the results of specifying --thin. I am unsure of how to use --include, so I can't put those results in as well. 


-bash-4.2# time hammer host list --thin true --organization-id 1
------|-------------------------------------------------|------------------|------------|----|-----|--------------|----------------------
ID    | NAME                                            | OPERATING SYSTEM | HOST GROUP | IP | MAC | CONTENT VIEW | LIFECYCLE ENVIRONMENT
------|-------------------------------------------------|------------------|------------|----|-----|--------------|----------------------
12868 | 7eb079806c6f                                    |                  |            |    |     |              |                      
12867 | errata.test                                     |                  |            |    |     |              |                
...
13537 | virt-who-fff6deb7.07ea.4f43.86d7.a79acef7c1ae-1 |                  |            |    |     |              |                      
15084 | virt-who-fffc49cb.5170.402a.98c3.d26317c22c11-1 |                  |            |    |     |              |                      
------|-------------------------------------------------|------------------|------------|----|-----|--------------|----------------------

real	0m8.999s
user	0m3.123s
sys	0m0.131s

Comment 8 Tomas Strachota 2017-10-24 11:31:57 UTC
Hammer propagates values of both --thin and --include to the server and the response is modified accordingly but hammer doesn't reflect on that with its output fields. So passing --thin results in a faster response and half empty table. Passing --include has no effect at all, because hammer just throws the additional fields away (include can add only parameters afair).

I agree that we need to implement displaying additional fields or limiting them on request. This feature is tracked here for upstream: http://projects.theforeman.org/issues/19135

Comment 9 Peter Ondrejka 2017-11-14 15:42:00 UTC
Verified on Sat 6.3 snap 24:

# hammer host list -h
Usage:
    hammer host list [OPTIONS]

Options:
 --environment ENVIRONMENT_NAME          Environment name
 --environment-id ENVIRONMENT_ID          
 --hostgroup HOSTGROUP_NAME              Hostgroup name
 --hostgroup-id HOSTGROUP_ID              
 --hostgroup-title HOSTGROUP_TITLE       Hostgroup title
 --location LOCATION_NAME                Location name
 --location-id LOCATION_ID                
 --location-title LOCATION_TITLE         Location title
 --order ORDER                           sort results
 --organization ORGANIZATION_NAME        Organization name
 --organization-id ORGANIZATION_ID       organization ID
 --organization-title ORGANIZATION_TITLE Organization title
 --page PAGE                             paginate results
 --per-page PER_PAGE                     number of entries per request
 --search SEARCH                         filter results
 -h, --help                              print help



# hammer hostgroup list -h
Usage:
    hammer hostgroup list [OPTIONS]

Options:
 --location LOCATION_NAME                Location name
 --location-id LOCATION_ID                
 --location-title LOCATION_TITLE         Location title
 --order ORDER                           sort results
 --organization ORGANIZATION_NAME        Organization name
 --organization-id ORGANIZATION_ID       organization ID
 --organization-title ORGANIZATION_TITLE Organization title
 --page PAGE                             paginate results
 --per-page PER_PAGE                     number of entries per request
 --puppet-class PUPPET_CLASS_NAME        Puppet class name
 --puppet-class-id PUPPET_CLASS_ID       ID of Puppet class
 --search SEARCH                         filter results
 -h, --help                              print help

Comment 10 Satellite Program 2018-02-21 16:54:17 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