Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1131911 - hammer user create --admin help output not intuitive
hammer user create --admin help output not intuitive
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Hammer (Show other bugs)
6.0.4
Unspecified Unspecified
low Severity medium (vote)
: Unspecified
: Unused
Assigned To: Mike McCune
Tazim Kolhar
http://projects.theforeman.org/issues...
: Triaged
Depends On:
Blocks: GSS_Sat6Beta_Tracker/GSS_Sat6_Tracker
  Show dependency treegraph
 
Reported: 2014-08-20 05:30 EDT by Clifford Perry
Modified: 2017-02-23 16:03 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-08-12 01:14:54 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 7284 None None None 2016-04-22 11:07 EDT
Red Hat Product Errata RHSA-2015:1592 normal SHIPPED_LIVE Important: Red Hat Satellite 6.1.1 on RHEL 6 2015-08-12 05:04:35 EDT

  None (edit)
Description Clifford Perry 2014-08-20 05:30:41 EDT
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 16:41:30 EDT
Created redmine issue http://projects.theforeman.org/issues/7284 from this bug
Comment 3 Bryan Kearney 2014-09-15 09:45:25 EDT
Moving to POST since upstream bug http://projects.theforeman.org/issues/7284 has been closed
Comment 4 Tazim Kolhar 2014-12-05 07:03:03 EST
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 08:04:33 EST
Moving to POST since upstream bug http://projects.theforeman.org/issues/7284 has been closed
Comment 8 Tazim Kolhar 2015-02-12 07:19:43 EST
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 09:35:54 EDT
This bug is slated to be released with Satellite 6.1.
Comment 11 errata-xmlrpc 2015-08-12 01:14:54 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/RHSA-2015:1592

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