1
0
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:
Daniel Molina 2012-10-22 16:23:13 +02:00
parent cad4919867
commit 845ccf9353

View File

@ -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