Bug 842969

Summary: Inappropriate error is shown if add/update sshkey without key file path specified
Product: OKD Reporter: joycezhang <jinzhang>
Component: ocAssignee: John (J5) Palmieri <johnp>
Status: CLOSED UPSTREAM QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: ccoleman, jkeck, qgong, rmillner, xtian
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-01 18:39:17 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:

Description joycezhang 2012-07-25 07:25:37 UTC
Description of problem:
Inappropriate error is shown if run "rhc sshkey add -i test" or "rhc sshkey update -i test" without key path specified.

Please refer to following error message:
# rhc sshkey add -i test
Password: ******

Generating ssh key pair for user 'test' in the dir '/root/.openshift/'
SSH key already exists: /root/.ssh/id_rsa.  Reusing...
/usr/local/share/gems/gems/rhc-0.96.3/lib/rhc-common.rb:1146:in `initialize': can't convert nil into String (TypeError)
	from /usr/local/share/gems/gems/rhc-0.96.3/lib/rhc-common.rb:1146:in `open'
	from /usr/local/share/gems/gems/rhc-0.96.3/lib/rhc-common.rb:1146:in `add_or_update_key'
	from /usr/local/share/gems/gems/rhc-0.96.3/bin/rhc-sshkey:162:in `<top (required)>'
	from /usr/local/bin/rhc-sshkey:23:in `load'
	from /usr/local/bin/rhc-sshkey:23:in `<main>'

Version-Release number of selected component (if applicable):
rhc-0.96.3
ec2-107-20-99-62.compute-1.amazonaws.com
Fedora 17

How reproducible:
always


Steps to Reproduce:
1. Run "rhc sshkey add -i keyname"
2. Run "rhc sshkey update -i keyname"

  
Actual results:
Error message is displayed.


Expected results:
Message prompt to tell user that keyfile path is required to add sshkey or generate a new pair of keys to upload.


Additional info:

Comment 1 Clayton Coleman 2012-07-30 04:24:18 UTC
We should add a cucumber test for this.

Comment 2 John (J5) Palmieri 2012-07-30 14:20:46 UTC
This issue happens because there is a /root/.ssh/id_rsa key but no /root/.ssh/id_rsa.pub key.  We need to discuss what to do with this situation.  We don't need to have a pub key file as we can generate it from the priv key.  I suggest making this into a story as it is unlikely this situation would occure and we need to handle this everywhere so it isn't just a quick fix.


My opinion is it should go hand in hand with moving the sshkey command to the new Commander framework.

Comment 3 John Poelstra 2012-07-31 17:17:39 UTC
clayton to review by end of the day

Comment 4 Clayton Coleman 2012-08-01 18:39:17 UTC
Agree with J5's comment.  Moving to story.

Comment 5 joycezhang 2012-08-15 10:30:25 UTC
*** Bug 848303 has been marked as a duplicate of this bug. ***