Bug 1131911 - hammer user create --admin help output not intuitive
Summary: hammer user create --admin help output not intuitive
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: 6.0.4
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: Unspecified
Assignee: Mike McCune
QA Contact: Tazim Kolhar
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks: GSS_Sat6Beta_Tracker, GSS_Sat6_Tracker
TreeView+ depends on / blocked
 
Reported: 2014-08-20 09:30 UTC by Clifford Perry
Modified: 2017-02-23 21:03 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-12 05:14:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 7284 0 None None None 2016-04-22 15:07:05 UTC
Red Hat Bugzilla 1135146 0 high CLOSED Satellite 6: missing man page for hammer 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHSA-2015:1592 0 normal SHIPPED_LIVE Important: Red Hat Satellite 6.1.1 on RHEL 6 2015-08-12 09:04:35 UTC

Internal Links: 1135146

Description Clifford Perry 2014-08-20 09:30:41 UTC
Description of problem:
Creating this as a usability bug with the hammer command line. I had to ask on IRC to find out the correct flag to pass to hammer to actually create a user as an administrator. It was not obvious or intuitive to me by reading the --help output as to what I should put. 

We should improve the --help output to let someone know when it is a true/false, vs string input or what is optional or not. 

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

[root@smqa-x3550m3-03 ~]# rpm -qa | grep -i hamm
rubygem-hammer_cli_foreman_tasks-0.0.3-3.el6sat.noarch
rubygem-hammer_cli_katello-0.0.4-12.el6sat.noarch
rubygem-hammer_cli-0.1.1-11.el6sat.noarch
rubygem-hammer_cli_foreman-0.1.1-15.el6sat.noarch


How reproducible:
Always (in this compose)

Steps to Reproduce:
1. hammer shell
2. user create --help
3. Try (mistakenly) 
 > user create --admin ADMIN --firstname Example --lastname User --login example --mail root@localhost --password redhat --auth-source-id 1
4. Try (correctly) 
 > user create --admin true --firstname Example --lastname User --login example1 --mail root@localhost --password redhat --auth-source-id 1

Actual results:
hammer> user create --help
Usage:
     user create [OPTIONS]

Options:
    --admin ADMIN                 Is an admin account?
    --auth-source-id AUTH_SOURCE_ID  
    --default-location-id DEFAULT_LOCATION_ID  
    --default-organization-id DEFAULT_ORGANIZATION_ID  
    --firstname FIRSTNAME          
    --lastname LASTNAME            
    --login LOGIN                  
    --mail MAIL                    
    --password PASSWORD            
    -h, --help                    print help
hammer>

Expected results:

    --admin true     <optional>     Is an admin account?
    --auth-source-id AUTH_SOURCE_ID  
    --default-location-id DEFAULT_LOCATION_ID   <optional>
    --default-organization-id DEFAULT_ORGANIZATION_ID  <optional>
    --firstname FIRSTNAME          
    --lastname LASTNAME            
    --login LOGIN                  
    --mail EMAIL                    
    --password PASSWORD            
    -h, --help                    print help

Additional info:

Side note - I've got no idea what Auth_source_ID is, but putting '1' worked. The help output doesn't indicate to me what I should put there nor why '1' worked for me. As such, my expected results output remains the same there due to my lack of understanding of what it is.

Comment 2 Dustin Tsang 2014-08-27 20:41:30 UTC
Created redmine issue http://projects.theforeman.org/issues/7284 from this bug

Comment 3 Bryan Kearney 2014-09-15 13:45:25 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/7284 has been closed

Comment 4 Tazim Kolhar 2014-12-05 12:03:03 UTC
FAILEDQA

*** This bug failed in upstream ***

Version Tested:

# rpm -qa | grep foreman
foreman-compute-1.8.0-0.develop.201412040955git563fa28.el7.noarch
ruby193-rubygem-foreman_discovery-1.4.1-1.el7.noarch
foreman-selinux-1.8.0-0.develop.201411281557gitf4a857f.el7.noarch
foreman-libvirt-1.8.0-0.develop.201412040955git563fa28.el7.noarch
ruby193-rubygem-foreman_bootdisk-4.0.2-1.el7.noarch
rubygem-hammer_cli_foreman_tasks-0.0.3-2.201409091410git163c264.git.0.988ca80.el7.noarch
foreman-ovirt-1.8.0-0.develop.201412040955git563fa28.el7.noarch
ruby193-rubygem-foreman_hooks-0.3.7-2.el7.noarch
foreman-postgresql-1.8.0-0.develop.201412040955git563fa28.el7.noarch
foreman-gce-1.8.0-0.develop.201412040955git563fa28.el7.noarch
foreman-vmware-1.8.0-0.develop.201412040955git563fa28.el7.noarch
ruby193-rubygem-foreman-tasks-0.6.9-1.el7.noarch
foreman-proxy-1.8.0-0.develop.201411261259git6ddd00d.el7.noarch
ibm-x3550m3-07.lab.eng.brq.redhat.com-foreman-proxy-1.0-1.noarch
ruby193-rubygem-foreman_docker-0.2.0-2.el7.noarch
rubygem-hammer_cli_foreman-0.1.3-1.201411121216git9381fc5.el7.noarch
foreman-1.8.0-0.develop.201412040955git563fa28.el7.noarch
ibm-x3550m3-07.lab.eng.brq.redhat.com-foreman-client-1.0-1.noarch
foreman-release-1.8.0-0.develop.201412040955git563fa28.el7.noarch

# hammer shell
Welcome to the hammer interactive shell
Type 'help' for usage information
hammer> user create --admin true --firstname Example --lastname User --login example --mail root@localhost --password redhat --auth-source-id 1
[Foreman] Username: admin
[Foreman] Password for admin: 
User created
hammer> user create --help
Usage:
     user create [OPTIONS]

Options:
 --admin ADMIN                                     is an admin account
                                                   One of true/false, yes/no, 1/0.
 --auth-source-id AUTH_SOURCE_ID                    
 --default-location-id DEFAULT_LOCATION_ID          
 --default-organization-id DEFAULT_ORGANIZATION_ID  
 --firstname FIRSTNAME                              
 --lastname LASTNAME                                
 --location-ids LOCATION_IDS                       REPLACE locations with given ids
                                                   Comma separated list of values.
 --login LOGIN                                      
 --mail MAIL                                        
 --organization-ids ORGANIZATION_IDS               REPLACE organizations with given ids.
                                                   Comma separated list of values.
 --password PASSWORD                                
 -h, --help                                        print help


For, admin it provides :  One of true/false, yes/no, 1/0.
As, said it should indicate what Auth_source_ID is, but putting '1' worked. The help output doesn't indicate to me what I should put there nor why '1' worked for me.

Comment 5 Bryan Kearney 2014-12-05 13:04:33 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/7284 has been closed

Comment 8 Tazim Kolhar 2015-02-12 12:19:43 UTC
VERIFIED:

# rpm -q | grep foreman
rpm: no arguments given for query
[root@qe-sat6-rhel7 ~]# rpm -qa | grep foreman
foreman-postgresql-1.7.2.4-1.el7sat.noarch
foreman-vmware-1.7.2.4-1.el7sat.noarch
ruby193-rubygem-foreman_bootdisk-4.0.2.4-1.el7.noarch
foreman-compute-1.7.2.4-1.el7sat.noarch
ruby193-rubygem-foreman_docker-1.1.0.2-1.el7sat.noarch
ruby193-rubygem-foreman-tasks-0.6.12.1-1.el7sat.noarch
rubygem-hammer_cli_foreman_tasks-0.0.3.1-1.el7.noarch
ruby193-rubygem-foreman_openscap-0.3.0-1.el7sat.noarch
foreman-1.7.2.4-1.el7sat.noarch
foreman-gce-1.7.2.4-1.el7sat.noarch
ruby193-rubygem-foreman_abrt-0.0.5-2.el7sat.noarch
rubygem-hammer_cli_foreman-0.1.4.3-1.el7sat.noarch
qe-sat6-rhel7.usersys.redhat.com-foreman-proxy-client-1.0-1.noarch
foreman-selinux-1.7.2.8-1.el7sat.noarch
foreman-ovirt-1.7.2.4-1.el7sat.noarch
ruby193-rubygem-foreman-redhat_access-0.0.7-2.el7sat.noarch
rubygem-hammer_cli_foreman_bootdisk-0.1.2.4-1.el7.noarch
foreman-proxy-1.7.2.1-1.el7sat.noarch
foreman-libvirt-1.7.2.4-1.el7sat.noarch
ruby193-rubygem-foreman_gutterball-0.0.1.4-1.el7sat.noarch
qe-sat6-rhel7.usersys.redhat.com-foreman-client-1.0-1.noarch
qe-sat6-rhel7.usersys.redhat.com-foreman-proxy-1.0-1.noarch
ruby193-rubygem-foreman_hooks-0.3.7-2.el7sat.noarch

hammer> user create --help
Usage:
     user create [OPTIONS]

Options:
 --admin ADMIN                                     is an admin account
                                                   One of true/false, yes/no, 1/0.
 --auth-source-id AUTH_SOURCE_ID                    
 --default-location-id DEFAULT_LOCATION_ID          
 --default-organization-id DEFAULT_ORGANIZATION_ID  
 --firstname FIRSTNAME                              
 --lastname LASTNAME                                
 --location-ids LOCATION_IDS                       REPLACE locations with given ids
                                                   Comma separated list of values.
 --locations LOCATION_NAMES                        Comma separated list of values.
 --login LOGIN                                      
 --mail MAIL                                        
 --organization-ids ORGANIZATION_IDS               REPLACE organizations with given ids.
                                                   Comma separated list of values.
 --organizations ORGANIZATION_NAMES                Comma separated list of values.
 --password PASSWORD                                
 -h, --help                                        print help

Comment 10 Bryan Kearney 2015-08-11 13:35:54 UTC
This bug is slated to be released with Satellite 6.1.

Comment 11 errata-xmlrpc 2015-08-12 05:14:54 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-2015:1592


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