From 2e4dcc9dda8a1cac000ea9eca32625cd3ba1b5d1 Mon Sep 17 00:00:00 2001 From: Ganesh Nalawade Date: Thu, 5 Oct 2017 15:32:43 +0530 Subject: [PATCH] Fix nxos terminal regex to parse xml response (#31283) Fixes #26130 Modify nxos terminal regex to parse a xml response. --- lib/ansible/plugins/terminal/nxos.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/plugins/terminal/nxos.py b/lib/ansible/plugins/terminal/nxos.py index 22ca2adcea4..5559bbe1ee5 100644 --- a/lib/ansible/plugins/terminal/nxos.py +++ b/lib/ansible/plugins/terminal/nxos.py @@ -28,7 +28,7 @@ from ansible.errors import AnsibleConnectionFailure class TerminalModule(TerminalBase): terminal_stdout_re = [ - re.compile(br'[\r\n]?[a-zA-Z]{1}[a-zA-Z0-9-_.]*[>|#|%](?:\s*)$'), + re.compile(br'[\r\n](?!\s*<)?[a-zA-Z_]{1}[a-zA-Z0-9-_.]*[>|#|%](?:\s*)$'), re.compile(br'[\r\n]?[a-zA-Z]{1}[a-zA-Z0-9-_.]*\(.+\)#(?:\s*)$') ]