Fixing minor logic error in error detection/handling in ssh connection plugin

If max retries were reached, no AnsibleConnectionFailure was raised, which
means potentially in some cases an unreachable error might not be returned
pull/15204/head
James Cammarata 9 years ago
parent 3ba54becd8
commit 6f8dbdd547

@ -601,7 +601,7 @@ class Connection(ConnectionBase):
# 0 = success # 0 = success
# 1-254 = remote command return code # 1-254 = remote command return code
# 255 = failure from the ssh command itself # 255 = failure from the ssh command itself
if return_tuple[0] != 255 or attempt == (remaining_tries - 1): if return_tuple[0] != 255:
break break
else: else:
raise AnsibleConnectionFailure("Failed to connect to the host via ssh.") raise AnsibleConnectionFailure("Failed to connect to the host via ssh.")

Loading…
Cancel
Save