Merge pull request #19752 from rallytime/remove_sshpass_checks

Remove sshpass checks
This commit is contained in:
Joseph Hall 2015-01-15 15:12:00 -07:00
commit 56a52f9552
11 changed files with 4 additions and 72 deletions

View File

@ -195,7 +195,6 @@ Depends
~~~~~~~
- `Salt Common`
- `sshpass`
- `Python MessagePack` (Messagepack C lib, or msgpack-pure)
Salt Cloud
@ -220,7 +219,6 @@ Depends
~~~~~~~
- `Salt Common`
- `sshpass`
- `apache libcloud` >= 0.14.0
Salt Doc

View File

@ -100,13 +100,6 @@ def create(vm_):
'''
Create a single VM from a data dict
'''
deploy = config.get_cloud_config_value('deploy', vm_, __opts__)
if deploy is True and salt.utils.which('sshpass') is None:
raise SaltCloudSystemExit(
'Cannot deploy salt in a VM if the \'sshpass\' binary is not '
'present on the system.'
)
salt.utils.cloud.fire_event(
'event',
'starting create',
@ -244,7 +237,6 @@ def create(vm_):
transport=__opts__['transport']
)
deployed = False
if win_installer:
deployed = salt.utils.cloud.deploy_windows(**deploy_kwargs)
else:

View File

@ -158,17 +158,9 @@ def create(vm_):
salt-cloud -p profile_name vm_name
'''
deploy = config.get_cloud_config_value('deploy', vm_, __opts__)
key_filename = config.get_cloud_config_value(
'private_key', vm_, __opts__, search_global=False, default=None
)
if deploy is True and key_filename is None and \
salt.utils.which('sshpass') is None:
raise SaltCloudSystemExit(
'Cannot deploy salt in a VM if the \'private_key\' setting '
'is not set and \'sshpass\' binary is not present on the '
'system for the password.'
)
salt.utils.cloud.fire_event(
'event',

View File

@ -535,14 +535,6 @@ def create(vm_):
)
)
if deploy is True and key_filename is None and \
salt.utils.which('sshpass') is None:
raise SaltCloudSystemExit(
'Cannot deploy salt in a VM if the \'ssh_key_file\' setting '
'is not set and \'sshpass\' binary is not present on the '
'system for the password.'
)
vm_['key_filename'] = key_filename
salt.utils.cloud.fire_event(

View File

@ -590,14 +590,6 @@ def create(vm_):
)
)
if deploy is True and key_filename is None and \
salt.utils.which('sshpass') is None:
raise SaltCloudSystemExit(
'Cannot deploy salt in a VM if the \'ssh_key_file\' setting '
'is not set and \'sshpass\' binary is not present on the '
'system for the password.'
)
vm_['key_filename'] = key_filename
salt.utils.cloud.fire_event(

View File

@ -258,13 +258,6 @@ def create(vm_):
'''
Create a single VM from a data dict
'''
deploy = config.get_cloud_config_value('deploy', vm_, __opts__)
if deploy is True and salt.utils.which('sshpass') is None:
raise SaltCloudSystemExit(
'Cannot deploy salt in a VM if the \'sshpass\' binary is not '
'present on the system.'
)
salt.utils.cloud.fire_event(
'event',
'starting create',

View File

@ -477,12 +477,6 @@ def create(vm_):
salt-cloud -p proxmox-ubuntu vmhostname
'''
ret = {}
deploy = config.get_cloud_config_value('deploy', vm_, __opts__)
if deploy is True and salt.utils.which('sshpass') is None:
raise SaltCloudSystemExit(
'Cannot deploy salt in a VM if the \'sshpass\' binary is not '
'present on the system.'
)
salt.utils.cloud.fire_event(
'event',
@ -647,7 +641,6 @@ def create(vm_):
transport=__opts__['transport']
)
deployed = False
if win_installer:
deployed = salt.utils.cloud.deploy_windows(**deploy_kwargs)
else:

View File

@ -196,12 +196,6 @@ def create(vm_):
Create a single VM from a data dict
'''
deploy = config.get_cloud_config_value('deploy', vm_, __opts__)
if deploy is True and salt.utils.which('sshpass') is None:
raise SaltCloudSystemExit(
'Cannot deploy salt in a VM if the \'sshpass\' binary is not '
'present on the system.'
)
salt.utils.cloud.fire_event(
'event',
'starting create',
@ -429,7 +423,6 @@ def create(vm_):
transport=__opts__['transport']
)
deployed = False
if win_installer:
deployed = salt.utils.cloud.deploy_windows(**deploy_kwargs)
else:

View File

@ -69,9 +69,11 @@ def create(vm_):
'No Deploy': '\'deploy\' is not enabled. Not deploying.'
}
}
key_filename = config.get_cloud_config_value(
'key_filename', vm_, __opts__, search_global=False, default=None
)
if key_filename is not None and not os.path.isfile(key_filename):
raise SaltCloudConfigError(
'The defined ssh_keyfile {0!r} does not exist'.format(
@ -79,13 +81,6 @@ def create(vm_):
)
)
if key_filename is None and salt.utils.which('sshpass') is None:
raise SaltCloudSystemExit(
'Cannot deploy salt in a VM if the \'ssh_keyfile\' setting '
'is not set and \'sshpass\' binary is not present on the '
'system for the password.'
)
ret = {}
log.info('Provisioning existing machine {0}'.format(vm_['name']))
@ -185,7 +180,6 @@ def create(vm_):
transport=__opts__['transport']
)
deployed = False
if win_installer:
deployed = salt.utils.cloud.deploy_windows(**deploy_kwargs)
else:

View File

@ -291,8 +291,8 @@ def bootstrap(version="develop",
script = 'https://bootstrap.saltstack.com'
for host in hosts.split(","):
# Could potentially lean on salt-ssh utils to make
# deployment easier on existing hosts (i.e. use sshpass,
# or expect, pass better options to ssh etc)
# deployment easier on existing hosts such as passing
# better options to ssh
subprocess.call(["ssh",
"root@" if root_user else "" + host,
"python -c 'import urllib; "

View File

@ -286,13 +286,6 @@ def bootstrap(vm_, opts):
)
)
if key_filename is None and salt.utils.which('sshpass') is None:
raise SaltCloudSystemExit(
'Cannot deploy salt in a VM if the \'ssh_keyfile\' setting '
'is not set and \'sshpass\' binary is not present on the '
'system for the password.'
)
if key_filename is None and ('password' not in vm_ or not vm_['password']):
raise SaltCloudSystemExit(
'Cannot deploy salt in a VM if the \'ssh_keyfile\' setting '