connection: raise exception return by SSH (#84592)

Fixes: #58133

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
Abhijeet Kasurde
2025-01-28 16:05:37 +01:00
committed by GitHub
parent ce392dd86e
commit 6db6d1967e
2 changed files with 4 additions and 0 deletions
@@ -0,0 +1,3 @@
---
bugfixes:
- ssh - Raise exception when sshpass returns error code (https://github.com/ansible/ansible/issues/58133).
+1
View File
@@ -450,6 +450,7 @@ def _handle_error(
'Upgrade sshpass to use sshpass_prompt, or otherwise switch to ssh keys.'
raise AnsibleError('{0} {1}'.format(msg, details))
msg = '{0} {1}'.format(msg, details)
raise AnsibleConnectionFailure(msg)
if return_tuple[0] == 255:
SSH_ERROR = True