mirror of
https://github.com/OpenNebula/one.git
synced 2025-04-02 10:50:07 +03:00
Revert "feature #1383: reformat rsa key to be compatible with ssh/openssl"
This reverts commit c795f95f3d0ce7f90e3f3b210d5aaf864d4ced3c.
This commit is contained in:
parent
cad4919867
commit
845ccf9353
@ -32,21 +32,6 @@ require 'econe/EC2QueryClient'
|
||||
|
||||
include CloudCLI
|
||||
|
||||
RSA_START="-----BEGIN RSA PRIVATE KEY-----"
|
||||
RSA_END="-----END RSA PRIVATE KEY-----"
|
||||
|
||||
def reformat_rsa(text)
|
||||
m=text.match(/^#{RSA_START}(.*)#{RSA_END}$/m)
|
||||
|
||||
if m
|
||||
RSA_START+"\n"+
|
||||
m[1].delete("\n").scan(/.{0,64}/).join("\n")+
|
||||
RSA_END
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
CommandParser::CmdParser.new(ARGV) do
|
||||
name "econe-create-keypair"
|
||||
usage "econe-create-keypair [OPTIONS] <keypair name>"
|
||||
@ -83,7 +68,7 @@ EOT
|
||||
STDOUT.puts "keyName: #{rc['keyName']}"
|
||||
STDOUT.puts "Fingerprint: #{rc['keyFingerprint']}"
|
||||
STDOUT.puts "Private Key:"
|
||||
STDOUT.puts reformat_rsa(rc['keyMaterial'])
|
||||
STDOUT.puts rc['keyMaterial']
|
||||
|
||||
exit_with_code 0
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user