# File lib/ec2/ec2.rb, line 700 def get_initial_password(instance_id, private_key) console_output = get_console_output(instance_id) crypted_password = console_output[:aws_output][%r{<Password>(.+)</Password>}m] && $1 unless crypted_password raise AwsError.new("Initial password was not found in console output for #{instance_id}") else OpenSSL::PKey::RSA.new(private_key).private_decrypt(Base64.decode64(crypted_password)) end rescue Exception on_exception end