mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-05 02:03:09 +00:00
Catch all request timeouts for winrm connection (#54104)
* Catch all request timeouts for winrm connection The current implementation only catches 'ConnectTimeout' exceptions. Instead we should catch 'Timout' which also catches ReadTimeout exceptions. Improves on: #51744 Co-Authored-By: westphahl <westphahl@gmail.com> * Changelog for winrm error handling improvement
This commit is contained in:
committed by
Jordan Borean
parent
e2d2874d81
commit
a44dfed570
4
changelogs/fragments/winrm-all-timeout-exceptions.yaml
Normal file
4
changelogs/fragments/winrm-all-timeout-exceptions.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
minor_changes:
|
||||
- Catch all connection timeout related exceptions and raise
|
||||
AnsibleConnectionError instead
|
||||
@@ -489,7 +489,7 @@ class Connection(ConnectionBase):
|
||||
% (to_native(response.std_out), to_native(stderr)))
|
||||
|
||||
return response
|
||||
except requests.exceptions.ConnectionError as exc:
|
||||
except requests.exceptions.Timeout as exc:
|
||||
raise AnsibleConnectionFailure('winrm connection error: %s' % to_native(exc))
|
||||
finally:
|
||||
if command_id:
|
||||
|
||||
Reference in New Issue
Block a user