diff --git a/src/cli/onehost b/src/cli/onehost index 110c49d3a3..24fcb39fc8 100755 --- a/src/cli/onehost +++ b/src/cli/onehost @@ -32,6 +32,7 @@ $: << RUBY_LIB_LOCATION+"/cli" require 'command_parser' require 'one_helper/onehost_helper' require 'one_helper/onecluster_helper' +require 'ec2_driver' cmd=CommandParser::CmdParser.new(ARGV) do usage "`onehost` [] []" @@ -124,12 +125,7 @@ cmd=CommandParser::CmdParser.new(ARGV) do exit -1 end - if !options[:ec2access].nil? && !options[:ec2secret].nil? - puts "madafakaaa" - puts "el acceso es "+options[:ec2access] - puts "la key es "+options[:ec2secret] - exit (-1) - end + encrypt(options) cid = options[:cluster] || ClusterPool::NONE_CLUSTER_ID diff --git a/src/vmm_mad/remotes/ec2/ec2_driver.rb b/src/vmm_mad/remotes/ec2/ec2_driver.rb index aafa9aedba..c4520fb49b 100755 --- a/src/vmm_mad/remotes/ec2/ec2_driver.rb +++ b/src/vmm_mad/remotes/ec2/ec2_driver.rb @@ -58,7 +58,16 @@ def handle_exception(action, ex, host, did, id = nil, file = nil) exit (-1) end +def encrypt(opts) + if !opts[:ec2access].nil? && !opts[:ec2secret].nil? + puts "el accesoas es "+opts[:ec2access] + puts "la key es "+opts[:ec2secret] + cipher = OpenSSL::Cipher.new("aes-256-cbc") + cipher.encrypt + exit (-1) + end +end begin