Bug 824318

Summary: The "rhc sshkey list " will be failed in Mac
Product: OKD Reporter: yquan <yquan>
Component: ocAssignee: Fabiano Franz <ffranz>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: high Docs Contact:
Priority: medium    
Version: 2.xCC: bmeng, rmillner
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rhc-0.93.16+ Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-08 17:58:36 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 yquan 2012-05-23 09:37:05 UTC
Description of problem:
The "rhc sshkey list " will be failed in Mac.

Version-Release number of selected component (if applicable):
rhc-0.93.6
ruby-1.8.7
gem-1.3.5

How reproducible:
Always

Steps to Reproduce:
1.Create a domain on Mac os.
2.Run "rhc sshkey list "
3.
  
Actual results:
It will be failed, and return the message like below.

/Library/Ruby/Gems/1.8/gems/rhc-0.93.6/lib/rhc-common.rb:309:in `get_ssh_keys': undefined method `load_data_public_key' for Net::SSH::KeyFactory:Class (NoMethodError)
	from /Library/Ruby/Gems/1.8/gems/rhc-0.93.6/bin/rhc-sshkey:71:in `show_key_list'
	from /Library/Ruby/Gems/1.8/gems/rhc-0.93.6/bin/rhc-sshkey:164
	from /usr/bin/rhc-sshkey:19:in `load'
	from /usr/bin/rhc-sshkey:19



Expected results:
It should the sshkey information correctly.

Additional info:

Comment 1 Meng Bo 2012-05-30 08:42:40 UTC
checked with latest rhc client rhc-0.93.15,
issue still can be reproduced.

Comment 2 Fabiano Franz 2012-05-30 18:30:36 UTC
Fixed on rhc-0.93.15+, tested on a MacOSX Lion.

Comment 3 yquan 2012-05-31 07:29:16 UTC
It is not fixed on rhc-0.93.16..


output:

OpenShiftmatoMacBook-Pro:~ root# rhc sshkey list
Password: **

/Library/Ruby/Gems/1.8/gems/rhc-0.93.16/lib/rhc-common.rb:311:in `get_ssh_keys': undefined method `load_data_public_key' for Net::SSH::KeyFactory:Class (NoMethodError)
	from /Library/Ruby/Gems/1.8/gems/rhc-0.93.16/bin/rhc-sshkey:71:in `show_key_list'
	from /Library/Ruby/Gems/1.8/gems/rhc-0.93.16/bin/rhc-sshkey:164
	from /usr/bin/rhc-sshkey:23:in `load'
	from /usr/bin/rhc-sshkey:23

Comment 4 Fabiano Franz 2012-05-31 17:03:10 UTC
Worked on my Mac box yesterday, I will try to reproduce and fix.

Comment 5 Fabiano Franz 2012-05-31 20:49:34 UTC
Fixed. 
I was *not* able to simulate this issue in the 2 Macbooks I got here, so I guess it's probably related to older versions of Mac OS, with older Ruby and net/ssh.
Anyway I added a fallback to native tools (ssh-keygen) if the pure Ruby version fails.

Comment 6 yquan 2012-06-01 02:13:15 UTC
It fixed on rhc-0.93.18.

OpenShiftmatoMacBook-Pro:~ root# rhc sshkey list
Password: **


SSH keys
========
       Name: default
       Type: ssh-rsa
Fingerprint: 62:59:bf:8d:6a:d7:ce:15:7e:ba:71:8c:10:62:13:d9