Bug 1023163

Summary: Hammer CLI: --help for many commands repeatedly appends options to the output
Product: Red Hat Satellite Reporter: Apurva Bhole <abhole>
Component: ProvisioningAssignee: Tomas Strachota <tstrachota>
Status: CLOSED CURRENTRELEASE QA Contact: Sachin Ghai <sghai>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.0.2CC: dcleal, ohadlevy, omaciel, sghai, tstrachota
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/3523
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-02 14:06:49 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 Apurva Bhole 2013-10-24 18:58:46 UTC
Description of problem:
--help for environment/domain/organization update/delete commands repearedly appends options to the output. 
The issue probably exists for all the commands for which --help fetches for options having unique constrain. Eg. id, name  

Version-Release number of selected component (if applicable):
foreman-postgresql-1.3.0-20.el6sat.noarch
ruby193-rubygem-foreman-katello-engine-0.0.17-6.el6sat.noarch
ruby193-rubygem-foreman_api-0.1.7-2.el6sat.noarch
apollo.usersys.redhat.com-foreman-proxy-1.0-1.noarch
rubygem-foreman_api-0.1.7-3.el6sat.noarch
foreman-1.3.0-20.el6sat.noarch
ruby193-rubygem-katello-foreman-engine-0.0.12-3.el6sat.noarch
foreman-proxy-1.3.0-3.el6sat.noarch
apollo.usersys.redhat.com-foreman-client-1.0-1.noarch
rubygem-hammer_cli_foreman-0.0.8-2.el6sat.noarch
katello-configure-foreman-1.4.7-7.el6sat.noarch
katello-foreman-all-1.4.6-47.el6sat.noarch

rubygem-hammer_cli-0.0.7-2.el6sat.noarch
rubygem-hammer_cli_foreman-0.0.8-2.el6sat.noarch

How reproducible:
always

Steps to Reproduce:
1. organization update --help
Usage:
    hammer organization update [OPTIONS]

Options:
    --id ID                       resource id
    --name NAME                   resource name
    --new-name NEW_NAME           new name for the resource
    -h, --help                    print help

2. organization update --help
Usage:
    hammer organization update [OPTIONS]

Options:
    --id ID                       resource id
    --name NAME                   resource name
    --new-name NEW_NAME           new name for the resource
    -h, --help                    print help
    --id ID                       resource id
    --name NAME                   resource name
    --new-name NEW_NAME           new name for the resource

3. organization update --help
Usage:
    hammer organization update [OPTIONS]

Options:
    --id ID                       resource id
    --name NAME                   resource name
    --new-name NEW_NAME           new name for the resource
    -h, --help                    print help
    --id ID                       resource id
    --name NAME                   resource name
    --new-name NEW_NAME           new name for the resource
    --id ID                       resource id
    --name NAME                   resource name
    --new-name NEW_NAME           new name for the resource


Expected results:
(Always)

Usage:
    hammer organization update [OPTIONS]

Options:
    --id ID                       resource id
    --name NAME                   resource name
    --new-name NEW_NAME           new name for the resource
    -h, --help                    print help

Comment 1 RHEL Program Management 2013-10-24 19:04:52 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 3 Dominic Cleal 2013-10-25 14:21:16 UTC
Got it.. when reproducing it, you need to run in "hammer shell".

Comment 6 Dominic Cleal 2014-01-29 14:05:53 UTC
Fixed in hammer-cli-foreman 0.0.16.

Comment 8 Sachin Ghai 2014-05-06 09:52:52 UTC
Verified with Satellite-6.0.3-RHEL-6-20140430.4

now --help doesn't append options to output.. Tried via hammer shell.

hammer> organization update --help
Usage:
     organization update [OPTIONS]

Options:
    --description DESCRIPTION     description
    --id ID                       resource id
    --name NAME                   resource name
    --new-name NEW_NAME           new name for the resource
    --redhat-repository-url REDHAT_REPOSITORY_URL Redhat CDN url
    -h, --help                    print help
hammer> organization update --help
Usage:
     organization update [OPTIONS]

Options:
    --description DESCRIPTION     description
    --id ID                       resource id
    --name NAME                   resource name
    --new-name NEW_NAME           new name for the resource
    --redhat-repository-url REDHAT_REPOSITORY_URL Redhat CDN url
    -h, --help                    print help
hammer> organization update --help
Usage:
     organization update [OPTIONS]

Options:
    --description DESCRIPTION     description
    --id ID                       resource id
    --name NAME                   resource name
    --new-name NEW_NAME           new name for the resource
    --redhat-repository-url REDHAT_REPOSITORY_URL Redhat CDN url
    -h, --help                    print help
hammer>

Comment 9 Sachin Ghai 2014-05-06 09:54:27 UTC
success for environment update, options doesn't append to the output

hammer> environment update --help
Usage:
     environment update [OPTIONS]

Options:
    --id ID                       resource id
    --name NAME                   resource name
    --new-name NEW_NAME           new name for the resource
    -h, --help                    print help
hammer> environment update --help
Usage:
     environment update [OPTIONS]

Options:
    --id ID                       resource id
    --name NAME                   resource name
    --new-name NEW_NAME           new name for the resource
    -h, --help                    print help
hammer> environment update --help
Usage:
     environment update [OPTIONS]

Options:
    --id ID                       resource id
    --name NAME                   resource name
    --new-name NEW_NAME           new name for the resource
    -h, --help                    print help
hammer>

Comment 10 Sachin Ghai 2014-05-06 09:54:59 UTC
hammer> domain update --help
Usage:
     domain update [OPTIONS]

Options:
    --description DESC            Full name describing the domain
    --dns-id DNS_ID               DNS Proxy to use within this domain
    --id ID                       resource id
    --name NAME                   resource name
    --new-name NEW_NAME           new name for the resource
    -h, --help                    print help
hammer> domain update --help
Usage:
     domain update [OPTIONS]

Options:
    --description DESC            Full name describing the domain
    --dns-id DNS_ID               DNS Proxy to use within this domain
    --id ID                       resource id
    --name NAME                   resource name
    --new-name NEW_NAME           new name for the resource
    -h, --help                    print help
hammer> domain update --help
Usage:
     domain update [OPTIONS]

Options:
    --description DESC            Full name describing the domain
    --dns-id DNS_ID               DNS Proxy to use within this domain
    --id ID                       resource id
    --name NAME                   resource name
    --new-name NEW_NAME           new name for the resource
    -h, --help                    print help
hammer>

Comment 11 Sachin Ghai 2014-05-06 09:55:47 UTC
hammer> domain delete --help
Usage:
     domain delete [OPTIONS]

Options:
    --id ID                       resource id
    --name NAME                   resource name
    -h, --help                    print help
hammer> domain delete --help
Usage:
     domain delete [OPTIONS]

Options:
    --id ID                       resource id
    --name NAME                   resource name
    -h, --help                    print help
hammer> environment delete --help
Usage:
     environment delete [OPTIONS]

Options:
    --id ID                       resource id
    --name NAME                   resource name
    -h, --help                    print help
hammer> environment delete --help
Usage:
     environment delete [OPTIONS]

Options:
    --id ID                       resource id
    --name NAME                   resource name
    -h, --help                    print help
hammer>

Comment 12 Bryan Kearney 2014-07-02 14:06:49 UTC
This was delivered with 6.0.3, which is the Satellite 6 Beta.