mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
winrm - fix failure parsing for send input errors (#56245)
This commit is contained in:
parent
826b99d4bd
commit
fd65f037f8
2 changed files with 4 additions and 2 deletions
2
changelogs/fragments/winrm-input-failures.yaml
Normal file
2
changelogs/fragments/winrm-input-failures.yaml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- winrm - Fix issue when attempting to parse CLIXML on send input failure
|
|
@ -481,8 +481,8 @@ class Connection(ConnectionBase):
|
||||||
except ValueError:
|
except ValueError:
|
||||||
# stdout does not contain a return response, stdin input was a fatal error
|
# stdout does not contain a return response, stdin input was a fatal error
|
||||||
stderr = to_bytes(response.std_err, encoding='utf-8')
|
stderr = to_bytes(response.std_err, encoding='utf-8')
|
||||||
if self.is_clixml(stderr):
|
if stderr.startswith(b"#< CLIXML"):
|
||||||
stderr = self.parse_clixml_stream(stderr)
|
stderr = _parse_clixml(stderr)
|
||||||
|
|
||||||
raise AnsibleError('winrm send_input failed; \nstdout: %s\nstderr %s'
|
raise AnsibleError('winrm send_input failed; \nstdout: %s\nstderr %s'
|
||||||
% (to_native(response.std_out), to_native(stderr)))
|
% (to_native(response.std_out), to_native(stderr)))
|
||||||
|
|
Loading…
Reference in a new issue