clean up auto deploy

This commit is contained in:
Thomas S Hatch 2013-07-21 23:06:17 -06:00
parent f27efb4a5e
commit 15557f7134

View File

@ -92,14 +92,16 @@ class SSH(object):
''' '''
Deploy the ssh key if the minions don't auth Deploy the ssh key if the minions don't auth
''' '''
if not isinstance(ret[host], basestring):
return ret
if ret[host].startswith('Permission denied'): if ret[host].startswith('Permission denied'):
target = self.targets[host] target = self.targets[host]
# permission denied, attempt to auto deploy ssh key # permission denied, attempt to auto deploy ssh key
print(('Permission denied for host {0}, do you want to ' print(('Permission denied for host {0}, do you want to '
'deploy the salt-ssh key?')) 'deploy the salt-ssh key?').format(host))
deploy = raw_input('[Y/n]') deploy = raw_input('[Y/n]')
if deploy.startswith(('n', 'N')): if deploy.startswith(('n', 'N')):
continue return ret
target['passwd'] = getpass.getpass( target['passwd'] = getpass.getpass(
'Password for {0}:'.format(host) 'Password for {0}:'.format(host)
) )