lib/security.rb in forj-0.0.40 vs lib/security.rb in forj-0.0.41

- old
+ new

@@ -136,11 +136,11 @@ rule = create_security_group_rule(oFC, security_group_id, protocol, port_min, port_max) end rule end - def keypair_detect(keypair_name, key_fullpath) + def keypair_detect(keypair_name, key_fullpath) # Build key data information structure. # Take care of priv with or without .pem and pubkey with pub. key_basename = File.basename(key_fullpath) key_path = File.expand_path(File.dirname(key_fullpath)) @@ -161,20 +161,20 @@ public_key_exist = File.exists?(File.join(key_path, key_basename + '.pub')) public_key_name = key_basename + '.pub' - result = {:keypair_name => keypair_name, - :keypair_path => key_path, :key_basename => key_basename, - :private_key_name => private_key_name, :private_key_exist? => private_key_exist, - :public_key_name => public_key_name, :public_key_exist? => public_key_exist, - } + {:keypair_name => keypair_name, + :keypair_path => key_path, :key_basename => key_basename, + :private_key_name => private_key_name, :private_key_exist? => private_key_exist, + :public_key_name => public_key_name, :public_key_exist? => public_key_exist, + } end def hpc_import_key(oForjAccount) - keys = keypair_detect(oForjAccount.get(:credentials, 'keypair_name'), oForjAccount.get(:credentials, 'keypair_path')) - account = oForjAccount.get(:account, :name) + keys = keypair_detect(oForjAccount.get('keypair_name'), oForjAccount.get('keypair_path')) + account = oForjAccount.get(:name) Logging.fatal(1, "'keypair_path' undefined. check your config.yaml file.") if not keys[:keypair_path] Logging.fatal(1, "'keypair_name' undefined. check your config.yaml file.") if not keys[:keypair_name] Logging.fatal(1, "keypair '%s' are missing. Please call 'forj setup %s' to create the missing key pair required." % [keys[:keypair_name], account]) if not keys[:public_key_exist?]