Bug 1013401 - Katello cmdline tool does not describe proper usage of commands
Katello cmdline tool does not describe proper usage of commands
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Hammer (Show other bugs)
Nightly
Unspecified Unspecified
unspecified Severity medium (vote)
: GA
: --
Assigned To: Martin Bacovsky
sthirugn@redhat.com
http://projects.theforeman.org/issues...
: Triaged
: 1044455 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-29 18:48 EDT by Magnus Glantz
Modified: 2016-07-27 06:58 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-07-27 06:58:59 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 4128 None None None 2016-04-22 10:57 EDT

  None (edit)
Description Magnus Glantz 2013-09-29 18:48:45 EDT
Description of problem:
The katello cmdline tool does not tell you all arguments needed for a specific command.

Version-Release number of selected component (if applicable):
1.4.8-1.git.4.c940d43.el6

How reproducible:
All the time.

Steps to Reproduce:
For example:
1. katello -u admin -p PASSWORD activation_key --help

Actual results:
# katello -u admin -p PASSWORD activation_key --help
Usage:  katello options activation_key command
Supported Commands:
	add_system_group add system group to an activation key
	create         create an activation key
	delete         delete an activation key
	info           show information about an activation key
	list           list all activation keys
	remove_system_group remove system groups to a system
	update         update an activation key

Options:
  -h, --help  show this help message and exit
# katello -u admin -p PASSWORD activation_key list
Usage:  katello options activation_key list options

katello: error: Option --org is required; please see --help

Expected results:
# katello -u admin -p PASSWORD activation_key --help
Usage:  katello options activation_key command --org <organization name>
Supported Commands:
	add_system_group add system group to an activation key
	create         create an activation key
	delete         delete an activation key
	info           show information about an activation key
	list           list all activation keys
	remove_system_group remove system groups to a system
	update         update an activation key

Options:
  -h, --help  show this help message and exit

Additional info:
As far as I can see, this is the case for all commands that requires --org or other extra options such as --product, --product_label, --product_id, etc.
Comment 1 Mike McCune 2013-10-10 13:55:07 EDT
moving to our downstream product to include this.  Our CLI is undergoing a lot
of work and this may be included
Comment 4 Bryan Kearney 2014-05-23 12:58:25 EDT
The new hammer_cli will resolve this issue. The katello command line
Comment 5 Bryan Kearney 2014-05-23 12:59:04 EDT
Sorry.. the katello command line has been deprecated.
Comment 6 sthirugn@redhat.com 2014-09-03 10:53:18 EDT
Failed.  The user is asking for documentation on required fields which is not there yet. Please see below.

Please note that Sat6 uses hammer cli.

# hammer -u admin -p changeme activation-key list --help
Usage:
    hammer activation-key list [OPTIONS]

Options:
    --by BY                       Field to sort the results on
    --content-view CONTENT_VIEW_NAME Content view name to search by
    --content-view-id CONTENT_VIEW_ID content view numeric identifier
    --full-results FULL_RESULTS   Whether or not to show all results
    --lifecycle-environment LIFECYCLE_ENVIRONMENT_NAME Name to search by
    --lifecycle-environment-id LIFECYCLE_ENVIRONMENT_ID  
    --name NAME                   activation key name to filter by
    --order ORDER                 Sort field and order, eg. 'name DESC'
    --organization ORGANIZATION_NAME Organization name to search by
    --organization-id ORGANIZATION_ID  
    --organization-label ORGANIZATION_LABEL Organization label to search by
    --page PAGE                   Page number, starting at 1
    --per-page PER_PAGE           Number of results per page to return
    --search SEARCH               Search string
    -h, --help                    print help
Comment 7 Bryan Kearney 2014-10-16 10:45:55 EDT
Connecting redmine issue http://projects.theforeman.org/issues/4128 from this bug
Comment 8 Adam Price 2014-12-10 11:56:23 EST
@suresh, i don't understand how this failed. can you explain more?
Comment 9 Magnus Glantz 2014-12-11 05:53:33 EST
So.. I see that it's named --organization instead of --org. But.. Isn't it applicable to --organization instead then?
Comment 10 Magnus Glantz 2014-12-11 05:59:22 EST
It's the same on what I think is the current version of the hammer cli tool.

[root@sat6 ~]# rpm -qa|grep hammer
rubygem-hammer_cli_foreman-0.1.1-16.el6sat.noarch
rubygem-hammer_cli-0.1.1-12.el6sat.noarch
rubygem-hammer_cli_katello-0.0.4-14.el6sat.noarch
rubygem-hammer_cli_foreman_tasks-0.0.3-3.el6sat.noarch
rubygem-hammer_cli_import-0.10.4-1.1.el6sat.noarch


[root@sat6 ~]# hammer -u Admin -p Password activation-key --help
Usage:
    hammer activation-key [OPTIONS] SUBCOMMAND [ARG] ...

Parameters:
    SUBCOMMAND                    subcommand
    [ARG] ...                     subcommand arguments

Subcommands:
    add-host-collection           Associate a resource
    add-subscription              Add subscription
    create                        Create an activation key
    delete                        Destroy an activation key
    host-collections              List associated host collections
    info                          Show an activation key
    list                          List activation keys
    remove-host-collection        Disassociate a resource
    remove-subscription           Remove subscription
    subscriptions                 List associated subscriptions
    update                        Update an activation key

Options:
    -h, --help                    print help
[root@devsedh2-lx9054 ~]# hammer -u Admin -p Password activation-key list
Error: Missing options to search organization
[root@sat6 ~]#
Comment 11 sthirugn@redhat.com 2014-12-29 21:49:54 EST
@Adam Price: If my understanding is correct, the user is asking to indicate the required fields in the help command.
Comment 12 Magnus Glantz 2015-01-07 03:47:03 EST
Yes, please. Without listing all required arguments, the --help information is  incorrect and risks leading the user to think that there is a bug.
Comment 13 Bryan Kearney 2015-01-09 09:38:38 EST
Upstream bug assigned to mbacovsk@redhat.com
Comment 14 Bryan Kearney 2016-03-18 13:57:22 EDT
*** Bug 1044455 has been marked as a duplicate of this bug. ***
Comment 15 Bryan Kearney 2016-04-26 12:05:09 EDT
really old bug. If I look at the original issue:

[vagrant@sat-test-rhel7 ~]$ hammer -u admin -p changeme  activation-key list
Error: Could not find organization, please set one of options --organization, --organization-label, --organization-id.


I am going to move this to ON_QA as it addresses the original issue.
Comment 17 Tomas Strachota 2016-06-01 10:07:49 EDT
Verified with satellite 6.2 snap 13

Help can't mark the options as required since there are multiple options to provide the same required information (--organization vs. --organization-d vs. --organization-label).
The commands now have more informative error messages pointing the user to what is missing.

$ hammer activation-key list
Error: Could not find organization, please set one of options --organization, --organization-label, --organization-id.
Comment 18 Bryan Kearney 2016-07-27 06:58:59 EDT
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

Note You need to log in before you can comment on or make changes to this bug.