Bug #1396

Wrong method to retrieve the public key in oneuser key command

Added by Daniel Molina almost 9 years ago. Updated almost 9 years ago.

Status:ClosedStart date:07/27/2012
Priority:NormalDue date:
Assignee:Daniel Molina% Done:

0%

Category:CLI
Target version:Release 3.8
Resolution:fixed Pull request:
Affected Versions:OpenNebula 3.6

Description

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'
from /usr/bin/oneuser:36

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:

  1. puts sshauth.public_key
    puts sshauth.password

When I run "oneuser key" now the correct public key is displayed.

Associated revisions

Revision ec533433
Added by Ruben S. Montero almost 9 years ago

bug #1396. Deprecate key command and upload fix as proposed by Rogier Mars

Revision c2f0d42e
Added by Ruben S. Montero over 8 years ago

bug #1396. Deprecate key command and upload fix as proposed by Rogier Mars
(cherry picked from commit ec533433fd5ef49c2347f0198d6452913fdc313c)

History

#1 Updated by Ruben S. Montero almost 9 years ago

  • Category set to CLI
  • Status changed from New to Closed
  • Resolution set to fixed

Also available in: Atom PDF