mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-20 15:51:05 +00: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:
@@ -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.")
|
||||
|
||||
Reference in New Issue
Block a user