Bug 1013401 - Katello cmdline tool does not describe proper usage of commands
Summary: Katello cmdline tool does not describe proper usage of commands
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: Nightly
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: Martin Bacovsky
QA Contact: sthirugn@redhat.com
URL: http://projects.theforeman.org/issues...
Whiteboard:
: 1044455 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-09-29 22:48 UTC by Magnus Glantz
Modified: 2019-09-26 18:19 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-27 10:58:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 4128 0 Normal New hammer $command --help should show mandatory and optional parameter differences 2020-08-26 15:39:21 UTC

Description Magnus Glantz 2013-09-29 22:48:45 UTC
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 17:55:07 UTC
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 16:58:25 UTC
The new hammer_cli will resolve this issue. The katello command line

Comment 5 Bryan Kearney 2014-05-23 16:59:04 UTC
Sorry.. the katello command line has been deprecated.

Comment 6 sthirugn@redhat.com 2014-09-03 14:53:18 UTC
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 14:45:55 UTC
Connecting redmine issue http://projects.theforeman.org/issues/4128 from this bug

Comment 8 Adam Price 2014-12-10 16:56:23 UTC
@suresh, i don't understand how this failed. can you explain more?

Comment 9 Magnus Glantz 2014-12-11 10:53:33 UTC
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 10:59:22 UTC
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-30 02:49:54 UTC
@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 08:47:03 UTC
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 14:38:38 UTC
Upstream bug assigned to mbacovsk

Comment 14 Bryan Kearney 2016-03-18 17:57:22 UTC
*** Bug 1044455 has been marked as a duplicate of this bug. ***

Comment 15 Bryan Kearney 2016-04-26 16:05:09 UTC
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 14:07:49 UTC
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 10:58:59 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


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