Bug 842969 - Inappropriate error is shown if add/update sshkey without key file path specified
Summary: Inappropriate error is shown if add/update sshkey without key file path speci...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: OKD
Classification: Red Hat
Component: oc
Version: 2.x
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: John (J5) Palmieri
QA Contact: libra bugs
URL:
Whiteboard:
: 848303 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-07-25 07:25 UTC by joycezhang
Modified: 2015-05-15 02:01 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-01 18:39:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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. ***


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