Bug 1476224

Summary: Creating SSH Key in User Template functionality missing in hammer CLI
Product: Red Hat Satellite Reporter: Jitendra Yejare <jyejare>
Component: Users & RolesAssignee: Martin Bacovsky <mbacovsk>
Status: CLOSED ERRATA QA Contact: Jitendra Yejare <jyejare>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: bbuckingham, dhlavacd, egolov, ehelms, jcallaha, mhulan, sgraessl, tstrachota, zhunting
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-hammer_cli_foreman-0.11.0.4 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 17:03:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1473944, 1493109    

Description Jitendra Yejare 2017-07-28 10:38:33 UTC
Description of problem:
Creating/Deleting/Viewing/Listing SSH Key in user template functionality is completely missing from hammer CLI

Version-Release number of selected component (if applicable):
Satellite 6.3 Snap 7

How reproducible:


Steps to Reproduce:
1. Create User with required details
2. From Hammer, Attempt to add ssh key in above user
3.

Actual results:
No provision to create/delete/view/list the ssh keys from CLI hammer in user template

Expected results:
Hammer CLI should have provision to create/view/list/delete the ssh key in user template

Additional info:
Functionality is available from API

Comment 2 Daniel Lobato Garcia 2017-08-01 13:54:36 UTC
Created redmine issue http://projects.theforeman.org/issues/20476 from this bug

Comment 3 Satellite Program 2017-09-18 20:03:33 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/20476 has been resolved.

Comment 4 Jitendra Yejare 2017-10-05 09:36:58 UTC
Failed QA!

Satellite 6.3.0 snap 18.0

I don't see any ssh-key option either in:
-> hammer user
-> hammer user create
-> hammer user update
-> hammer ssh-key

So, failing this bug.

Comment 5 Satellite Program 2017-10-05 10:05:48 UTC
Upstream bug assigned to tstrachota

Comment 8 Satellite Program 2017-10-06 14:17:44 UTC
Upstream bug assigned to tstrachota

Comment 11 Satellite Program 2017-10-11 12:09:49 UTC
Upstream bug assigned to mbacovsk

Comment 12 Satellite Program 2017-10-11 12:09:53 UTC
Upstream bug assigned to mbacovsk

Comment 13 Satellite Program 2017-10-11 14:11:46 UTC
Upstream bug assigned to mbacovsk

Comment 14 Satellite Program 2017-10-11 14:11:50 UTC
Upstream bug assigned to mbacovsk

Comment 15 Jitendra Yejare 2017-11-21 13:42:25 UTC
Verified !

@ Satellite 6.3 snap 25

Commands are available to add, delete, info and list the ssh-key:

```
# hammer user ssh-keys --help
Usage:
    hammer user ssh-keys [OPTIONS] SUBCOMMAND [ARG] ...

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

Subcommands:
 add                           Create an SSH key for a user
 delete                        Delete an SSH key for a user
 info                          Show an SSH key from a user
 list                          List all SSH keys for a user

Options:
 -h, --help                    print help
```

Each option is tested thoroughly and all works nicely.


The only gap I see in CLI compare to UI is,

While creating an ssh-key in user UI automatically populates the ssh-key name from ssh-key. But CLI hammer doesn't and asks for name compulsory. It would be nice to drag that functionality from UI to CLI.
But anyhow that doesn't block this bug from verification.

Comment 16 Bryan Kearney 2018-02-21 17:03:56 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-2018:0336