Wrong method to retrieve the public key in oneuser key command
|Assignee:||Daniel Molina||% Done:|
|Target version:||Release 3.8|
|Affected Versions:||OpenNebula 3.6|
From [one-users] oneuser key command failing by Rogier Mars
I just upgrade to opennebula 3.6 (from the rpm's for CentOS) and decided to give ssh authentication a try. While following the documentation the step to output the public key failed:
[root@cloudcontroller1 rogierm]# oneuser key
Enter PEM pass phrase:
/usr/bin/oneuser:250: undefined method `public_key' for #<SshAuth:0x7ffc04405ff8> (NoMethodError)
from /usr/lib/one/ruby/cli/command_parser.rb:173:in `call'
from /usr/lib/one/ruby/cli/command_parser.rb:173:in `run'
from /usr/lib/one/ruby/cli/command_parser.rb:79:in `initialize'
from /usr/bin/oneuser:36:in `new'
I had a quick look at the code and method "public_key" that is referenced in oneuser line 250 does not exist in the file /usr/lib/one/ruby/ssh_auth.rb. There is a method password that seems to print the public key. I've changed line 250 in oneuser to the following:
- puts sshauth.public_key
When I run "oneuser key" now the correct public key is displayed.