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

View File

@ -100,13 +100,6 @@ def create(vm_):
''' '''
Create a single VM from a data dict 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( salt.utils.cloud.fire_event(
'event', 'event',
'starting create', 'starting create',
@ -244,7 +237,6 @@ def create(vm_):
transport=__opts__['transport'] transport=__opts__['transport']
) )
deployed = False
if win_installer: if win_installer:
deployed = salt.utils.cloud.deploy_windows(**deploy_kwargs) deployed = salt.utils.cloud.deploy_windows(**deploy_kwargs)
else: else:

View File

@ -158,17 +158,9 @@ def create(vm_):
salt-cloud -p profile_name vm_name salt-cloud -p profile_name vm_name
''' '''
deploy = config.get_cloud_config_value('deploy', vm_, __opts__)
key_filename = config.get_cloud_config_value( key_filename = config.get_cloud_config_value(
'private_key', vm_, __opts__, search_global=False, default=None '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( salt.utils.cloud.fire_event(
'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 vm_['key_filename'] = key_filename
salt.utils.cloud.fire_event( 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 vm_['key_filename'] = key_filename
salt.utils.cloud.fire_event( salt.utils.cloud.fire_event(

View File

@ -258,13 +258,6 @@ def create(vm_):
''' '''
Create a single VM from a data dict 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( salt.utils.cloud.fire_event(
'event', 'event',
'starting create', 'starting create',

View File

@ -477,12 +477,6 @@ def create(vm_):
salt-cloud -p proxmox-ubuntu vmhostname salt-cloud -p proxmox-ubuntu vmhostname
''' '''
ret = {} 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( salt.utils.cloud.fire_event(
'event', 'event',
@ -647,7 +641,6 @@ def create(vm_):
transport=__opts__['transport'] transport=__opts__['transport']
) )
deployed = False
if win_installer: if win_installer:
deployed = salt.utils.cloud.deploy_windows(**deploy_kwargs) deployed = salt.utils.cloud.deploy_windows(**deploy_kwargs)
else: else:

View File

@ -196,12 +196,6 @@ def create(vm_):
Create a single VM from a data dict Create a single VM from a data dict
''' '''
deploy = config.get_cloud_config_value('deploy', vm_, __opts__) 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( salt.utils.cloud.fire_event(
'event', 'event',
'starting create', 'starting create',
@ -429,7 +423,6 @@ def create(vm_):
transport=__opts__['transport'] transport=__opts__['transport']
) )
deployed = False
if win_installer: if win_installer:
deployed = salt.utils.cloud.deploy_windows(**deploy_kwargs) deployed = salt.utils.cloud.deploy_windows(**deploy_kwargs)
else: else:

View File

@ -69,9 +69,11 @@ def create(vm_):
'No Deploy': '\'deploy\' is not enabled. Not deploying.' 'No Deploy': '\'deploy\' is not enabled. Not deploying.'
} }
} }
key_filename = config.get_cloud_config_value( key_filename = config.get_cloud_config_value(
'key_filename', vm_, __opts__, search_global=False, default=None 'key_filename', vm_, __opts__, search_global=False, default=None
) )
if key_filename is not None and not os.path.isfile(key_filename): if key_filename is not None and not os.path.isfile(key_filename):
raise SaltCloudConfigError( raise SaltCloudConfigError(
'The defined ssh_keyfile {0!r} does not exist'.format( '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 = {} ret = {}
log.info('Provisioning existing machine {0}'.format(vm_['name'])) log.info('Provisioning existing machine {0}'.format(vm_['name']))
@ -185,7 +180,6 @@ def create(vm_):
transport=__opts__['transport'] transport=__opts__['transport']
) )
deployed = False
if win_installer: if win_installer:
deployed = salt.utils.cloud.deploy_windows(**deploy_kwargs) deployed = salt.utils.cloud.deploy_windows(**deploy_kwargs)
else: else:

View File

@ -291,8 +291,8 @@ def bootstrap(version="develop",
script = 'https://bootstrap.saltstack.com' script = 'https://bootstrap.saltstack.com'
for host in hosts.split(","): for host in hosts.split(","):
# Could potentially lean on salt-ssh utils to make # Could potentially lean on salt-ssh utils to make
# deployment easier on existing hosts (i.e. use sshpass, # deployment easier on existing hosts such as passing
# or expect, pass better options to ssh etc) # better options to ssh
subprocess.call(["ssh", subprocess.call(["ssh",
"root@" if root_user else "" + host, "root@" if root_user else "" + host,
"python -c 'import urllib; " "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']): if key_filename is None and ('password' not in vm_ or not vm_['password']):
raise SaltCloudSystemExit( raise SaltCloudSystemExit(
'Cannot deploy salt in a VM if the \'ssh_keyfile\' setting ' 'Cannot deploy salt in a VM if the \'ssh_keyfile\' setting '