Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1417015 - [RFE] From hammer cli, creating external user-group does not have any option --auth-source-name as a input parameter.
[RFE] From hammer cli, creating external user-group does not have any option ...
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: LDAP (Show other bugs)
6.2.6
x86_64 Linux
unspecified Severity medium (vote)
: Unspecified
: Unused
Assigned To: Dominik Hlavac Duran
Sanket Jagtap
: FutureFeature
Depends On:
Blocks: 260381
  Show dependency treegraph
 
Reported: 2017-01-26 19:55 EST by Amit Kumar Das
Modified: 2018-10-16 11:28 EDT (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-10-16 11:27:25 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 18805 None None None 2017-03-06 08:42 EST
Red Hat Product Errata RHSA-2018:2927 None None None 2018-10-16 11:28 EDT

  None (edit)
Description Amit Kumar Das 2017-01-26 19:55:35 EST
Description of problem:

In Hammer CLI, when we create external user-group, the only input parameter
available is --auth-source-id. No option available with --auth-source-name as a parameter.

#hammer user-group external create --help
Usage:
    hammer user-group external create [OPTIONS]

Options:
 --auth-source-id AUTH_SOURCE_ID ID of linked authentication source
 --name NAME                     External user group name
 --user-group USER_GROUP_NAME    Name to search by
 --user-group-id USER_GROUP_ID    
 -h, --help                      print help
 

Version-Release number of selected component (if applicable):
# rpm -qa|grep -i satellite
satellite-6.2.6-2.0.el7sat.noarch
# hammer --version
hammer (0.5.1.11)

How reproducible:

# hammer auth-source ldap list                                   
---|----------|--------|------|---------------
ID | NAME     | LDAPS? | PORT | SERVER TYPE   
---|----------|--------|------|---------------
3  | AD-AUTH  |        | 389  | AuthSourceLdap
5  | IPA-AUTH |        | 389  | AuthSourceLdap
7  | rhel-idm |        | 389  | AuthSourceLdap
---|----------|--------|------|---------------

# hammer user-group  list 
---|---------
ID | NAME    
---|---------
4  | onlyview
---|---------

# hammer user-group  external list --user-group onlyview
---|-------------|------------
ID | NAME        | AUTH SOURCE
---|-------------|------------
2  | view-access | rhel-idm   
---|-------------|------------

# hammer user-group external create --auth-source-id 7 --name view-access-1 --user-group onlyview
External user group created
# 

# hammer user-group  external list --user-group onlyview
---|---------------|------------
ID | NAME          | AUTH SOURCE
---|---------------|------------
2  | view-access   | rhel-idm   
3  | view-access-1 | rhel-idm   
---|---------------|------------

# hammer user-group external create --help
Options:
 --auth-source-id AUTH_SOURCE_ID ID of linked authentication source
 --name NAME                     External user group name
 --user-group USER_GROUP_NAME    Name to search by
 --user-group-id USER_GROUP_ID    
 -h, --help                      print help


From the above we can see there is only one option to create external user-group i.e. --auth-source-id.

No option available with --auth-source-name or --auth-source as a input parameter.

Expected results:
auth-source-name or auth-source must be available as a input parameter.


Additional info:
This makes scripting the creation of external user-groups difficult as you must first parse the auth source list to find the id.
Comment 5 Tomas Strachota 2017-03-06 08:42:45 EST
Created redmine issue http://projects.theforeman.org/issues/18805 from this bug
Comment 9 pm-sat@redhat.com 2018-02-26 06:08:14 EST
Upstream bug assigned to dhlavacd@redhat.com
Comment 11 Sanket Jagtap 2018-09-21 09:08:38 EDT
Build:Satellite 6.4.0 snap22

hammer> user-group external create --name foobargroup --user-group-id 1 --auth-source IDM
External user group created.
hammer> user-group external list --user-group foobargroup
---|-------------|------------
ID | NAME        | AUTH SOURCE
---|-------------|------------
2  | foobargroup | IDM        
---|-------------|------------
hammer> auth-source list 
---|----------|--------------------
ID | NAME     | TYPE OF AUTH SOURCE
---|----------|--------------------
1  | Internal | AuthSourceInternal 
3  | IDM      | AuthSourceLdap     
---|----------|--------------------

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

Options:
 --auth-source AUTH_SOURCE_NAME          Name to search by
 --auth-source-id AUTH_SOURCE_ID          
 --location LOCATION_NAME                Location name
 --location-id LOCATION_ID                
 --location-title LOCATION_TITLE         Location title
 --name NAME                             External user group name
 --organization ORGANIZATION_NAME        Organization name
 --organization-id ORGANIZATION_ID       Organization ID
 --organization-title ORGANIZATION_TITLE Organization title
 --user-group USER_GROUP_NAME            Name to search by
 --user-group-id USER_GROUP_ID            
 -h, --help                              Print help
Comment 13 errata-xmlrpc 2018-10-16 11:27:25 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-2018:2927

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