mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
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
This commit is contained in:
parent
f0d3284ead
commit
1a5ee115f0
1 changed files with 1 additions and 1 deletions
|
@ -591,7 +591,7 @@ class Connection(ConnectionBase):
|
|||
# 0 = success
|
||||
# 1-254 = remote command return code
|
||||
# 255 = failure from the ssh command itself
|
||||
if return_tuple[0] != 255 or attempt == (remaining_tries - 1):
|
||||
if return_tuple[0] != 255:
|
||||
break
|
||||
else:
|
||||
raise AnsibleConnectionFailure("Failed to connect to the host via ssh.")
|
||||
|
|
Loading…
Reference in a new issue