Skip to content

Commit

Permalink
Fix to allow password for salt-cloud to be set outside of a vm specif…
Browse files Browse the repository at this point in the history
…ic context.

Fixes saltstack#24871.
  • Loading branch information
dkiser authored and cro committed Jun 23, 2015
1 parent 9b70f01 commit 8acbf74
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion salt/utils/cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,14 @@ def bootstrap(vm_, opts):
if stat.S_ISSOCK(os.stat(os.environ['SSH_AUTH_SOCK']).st_mode):
has_ssh_agent = True

if key_filename is None and ('password' not in vm_ or not vm_['password']) and has_ssh_agent is False:
if (key_filename is None and
salt.config.get_cloud_config_value(
'password', vm_, opts, default=None
) is None and
salt.config.get_cloud_config_value(
'win_password', vm_, opts, default=None
) is None and
has_ssh_agent is False):
raise SaltCloudSystemExit(
'Cannot deploy salt in a VM if the \'ssh_keyfile\' setting '
'is not set and there is no password set for the vm. '
Expand Down

0 comments on commit 8acbf74

Please sign in to comment.