Bug 856038

Summary: Can not display sshkeys on Mac OS X
Product: OKD Reporter: Jianwei Hou <jhou>
Component: ocAssignee: N. Harrison Ripps <hripps>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: hripps, xtian
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-09-17 21:30:06 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 Jianwei Hou 2012-09-11 03:33:42 UTC
Description of problem:
On Mac OS X, can not display sshkeys using 'rhc sshkey list'

Version-Release number of selected component (if applicable):
OS: Mac OS X
ruby 1.8.7
CLI: rhc-0.98.13


How reproducible:
Always

Steps to Reproduce:
1. rhc sshkey add rsa ~/.ssh/id_rsa.pub
2. rhc sshkey list

  
Actual results:
OpenShiftmatoMacBook-Pro:.ssh OpenShift$ rhc sshkey list
Password: ******
 
 
RESULT:
/Library/Ruby/Gems/1.8/gems/rhc-0.98.13/lib/rhc/rest/key.rb:35:in `fingerprint': undefined method `load_data_public_key' for Net::SSH::KeyFactory:Class (NoMethodError)
        from (erb):3:in `format'
        from /Library/Ruby/Gems/1.8/gems/rhc-0.98.13/lib/rhc/ssh_key_helpers.rb:70:in `format'
        from /Library/Ruby/Gems/1.8/gems/rhc-0.98.13/lib/rhc/commands/sshkey.rb:22:in `list'
        from /Library/Ruby/Gems/1.8/gems/rhc-0.98.13/lib/rhc/commands/sshkey.rb:21:in `each'
        from /Library/Ruby/Gems/1.8/gems/rhc-0.98.13/lib/rhc/commands/sshkey.rb:21:in `list'
        from /Library/Ruby/Gems/1.8/gems/rhc-0.98.13/lib/rhc/helpers.rb:219:in `results'
        from /Library/Ruby/Gems/1.8/gems/rhc-0.98.13/lib/rhc/helpers.rb:190:in `call'
        from /Library/Ruby/Gems/1.8/gems/rhc-0.98.13/lib/rhc/helpers.rb:190:in `section'
        from /Library/Ruby/Gems/1.8/gems/rhc-0.98.13/lib/rhc/helpers.rb:207:in `paragraph'
        from /Library/Ruby/Gems/1.8/gems/rhc-0.98.13/lib/rhc/helpers.rb:217:in `results'
        from /Library/Ruby/Gems/1.8/gems/rhc-0.98.13/lib/rhc/commands/sshkey.rb:18:in `list'
        from /Library/Ruby/Gems/1.8/gems/rhc-0.98.13/lib/rhc/commands.rb:103:in `send'
        from /Library/Ruby/Gems/1.8/gems/rhc-0.98.13/lib/rhc/commands.rb:103:in `to_commander'
        from /Library/Ruby/Gems/1.8/gems/commander-4.1.2/lib/commander/command.rb:180:in `call'
        from /Library/Ruby/Gems/1.8/gems/commander-4.1.2/lib/commander/command.rb:180:in `call'
        from /Library/Ruby/Gems/1.8/gems/commander-4.1.2/lib/commander/command.rb:155:in `run'
        from /Library/Ruby/Gems/1.8/gems/commander-4.1.2/lib/commander/runner.rb:402:in `run_active_command'
        from /Library/Ruby/Gems/1.8/gems/rhc-0.98.13/lib/rhc/command_runner.rb:30:in `run!'
        from /Library/Ruby/Gems/1.8/gems/commander-4.1.2/lib/commander/delegates.rb:7:in `run!'
        from /Library/Ruby/Gems/1.8/gems/rhc-0.98.13/lib/rhc/cli.rb:36:in `start'
        from /Library/Ruby/Gems/1.8/gems/rhc-0.98.13/bin/rhc:61
        from /usr/bin/rhc:23:in `load'
        from /usr/bin/rhc:23

Expected results:
Added keys should be displayed correctly

Additional info:
Did not reproduce on Fedora 16/17, Windows 7, Ubuntu, RHEL6.2

Comment 1 Jianwei Hou 2012-09-11 05:15:22 UTC
Added net-ssh version: 

OpenShiftmatoMacBook-Pro:~ OpenShift$ gem list|grep net-ssh
net-ssh (2.0.4, 1.1.4)
net-ssh-gateway (1.0.0)

Comment 2 Jianwei Hou 2012-09-11 06:03:10 UTC
Same problem with 'rhc sshkey show' on Mac OS X

Comment 3 N. Harrison Ripps 2012-09-11 12:50:17 UTC
Assigned

Comment 4 N. Harrison Ripps 2012-09-11 15:12:49 UTC
rhc uses the load_data_public_key() method, which was added to Net::SSH in version 2.0.11. I have updated the rhc gemspec file to enforce this minimum requirement.

Comment 5 Xiaoli Tian 2012-09-12 10:12:06 UTC
This pull request is still not merged, https://github.com/openshift/rhc/pull/156

so it's not fixed in 0.98.14, remove 0.98.14 from fixed in version.

Wait for next version to verify.

Comment 6 Jianwei Hou 2012-09-13 02:17:47 UTC
Verified with rhc-0.99.1 on Mac OS X

Steps:
1. Add an sshkey: rhc sshkey add default ~/.ssh/id_rsa.pub
2. rhc sshkey list

OpenShiftmatoMacBook-Pro:~ OpenShift$ rhc sshkey list
Password: **


RESULT:
       Name: default
       Type: ssh-rsa
Fingerprint: 13:10:95:30:63:a8:4a:00:6b:4b:09:d2:fe:53:81:11