From fd65f037f8c1f4ccd110454a40df15dcadd4cbb4 Mon Sep 17 00:00:00 2001 From: Jordan Borean Date: Tue, 14 May 2019 19:55:41 -0400 Subject: [PATCH] winrm - fix failure parsing for send input errors (#56245) --- changelogs/fragments/winrm-input-failures.yaml | 2 ++ lib/ansible/plugins/connection/winrm.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/winrm-input-failures.yaml diff --git a/changelogs/fragments/winrm-input-failures.yaml b/changelogs/fragments/winrm-input-failures.yaml new file mode 100644 index 00000000000..138d95811ee --- /dev/null +++ b/changelogs/fragments/winrm-input-failures.yaml @@ -0,0 +1,2 @@ +bugfixes: +- winrm - Fix issue when attempting to parse CLIXML on send input failure diff --git a/lib/ansible/plugins/connection/winrm.py b/lib/ansible/plugins/connection/winrm.py index 87d1d66d8eb..4309a5d88b7 100644 --- a/lib/ansible/plugins/connection/winrm.py +++ b/lib/ansible/plugins/connection/winrm.py @@ -481,8 +481,8 @@ class Connection(ConnectionBase): except ValueError: # stdout does not contain a return response, stdin input was a fatal error stderr = to_bytes(response.std_err, encoding='utf-8') - if self.is_clixml(stderr): - stderr = self.parse_clixml_stream(stderr) + if stderr.startswith(b"#< CLIXML"): + stderr = _parse_clixml(stderr) raise AnsibleError('winrm send_input failed; \nstdout: %s\nstderr %s' % (to_native(response.std_out), to_native(stderr)))