Bug 842969 - Inappropriate error is shown if add/update sshkey without key file path specified
Inappropriate error is shown if add/update sshkey without key file path speci...
Status: CLOSED UPSTREAM
Product: OpenShift Origin
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
2.x
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: John (J5) Palmieri
libra bugs
: Triaged
: 848303 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-25 03:25 EDT by joycezhang
Modified: 2015-05-14 22:01 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-08-01 14:39:17 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)

  None (edit)
Description joycezhang 2012-07-25 03:25:37 EDT
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 00:24:18 EDT
We should add a cucumber test for this.
Comment 2 John (J5) Palmieri 2012-07-30 10:20:46 EDT
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 13:17:39 EDT
clayton to review by end of the day
Comment 4 Clayton Coleman 2012-08-01 14:39:17 EDT
Agree with J5's comment.  Moving to story.
Comment 5 joycezhang 2012-08-15 06:30:25 EDT
*** Bug 848303 has been marked as a duplicate of this bug. ***

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