mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix infinite loops on failed Windows deployments
This commit is contained in:
parent
f2b0c9b4fa
commit
f3dcfca4e0
1 changed files with 22 additions and 22 deletions
|
@ -806,21 +806,21 @@ def wait_for_winexesvc(host, port, username, password, timeout=900):
|
|||
log.debug('winexe connected...')
|
||||
return True
|
||||
log.debug('Return code was {0}'.format(ret_code))
|
||||
time.sleep(1)
|
||||
except socket.error as exc:
|
||||
log.debug('Caught exception in wait_for_winexesvc: {0}'.format(exc))
|
||||
time.sleep(1)
|
||||
if time.time() - start > timeout:
|
||||
log.error('winexe connection timed out: {0}'.format(timeout))
|
||||
return False
|
||||
log.debug(
|
||||
'Retrying winexe connection to host {0} on port {1} '
|
||||
'(try {2})'.format(
|
||||
host,
|
||||
port,
|
||||
try_count
|
||||
)
|
||||
|
||||
if time.time() - start > timeout:
|
||||
log.error('winexe connection timed out: {0}'.format(timeout))
|
||||
return False
|
||||
log.debug(
|
||||
'Retrying winexe connection to host {0} on port {1} '
|
||||
'(try {2})'.format(
|
||||
host,
|
||||
port,
|
||||
try_count
|
||||
)
|
||||
)
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
def wait_for_winrm(host, port, username, password, timeout=900):
|
||||
|
@ -846,19 +846,19 @@ def wait_for_winrm(host, port, username, password, timeout=900):
|
|||
log.debug('WinRM session connected...')
|
||||
return s
|
||||
log.debug('Return code was {0}'.format(r.status_code))
|
||||
time.sleep(1)
|
||||
except WinRMTransportError as exc:
|
||||
log.debug('Caught exception in wait_for_winrm: {0}'.format(exc))
|
||||
if time.time() - start > timeout:
|
||||
log.error('WinRM connection timed out: {0}'.format(timeout))
|
||||
return None
|
||||
log.debug(
|
||||
'Retrying WinRM connection to host {0} on port {1} '
|
||||
'(try {2})'.format(
|
||||
host, port, trycount
|
||||
)
|
||||
|
||||
if time.time() - start > timeout:
|
||||
log.error('WinRM connection timed out: {0}'.format(timeout))
|
||||
return None
|
||||
log.debug(
|
||||
'Retrying WinRM connection to host {0} on port {1} '
|
||||
'(try {2})'.format(
|
||||
host, port, trycount
|
||||
)
|
||||
time.sleep(1)
|
||||
)
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
def validate_windows_cred(host,
|
||||
|
|
Loading…
Add table
Reference in a new issue