From 28fb690cc3290ef41d28f5121dabe054b291a0d3 Mon Sep 17 00:00:00 2001 From: Trishna Guha Date: Wed, 21 Feb 2018 13:25:12 +0530 Subject: [PATCH] fail module when config is invalid and jsonrpc doesn't return error (#36482) (#36488) Signed-off-by: Trishna Guha (cherry picked from commit d5858bbcbe14c4afe2e8e24dac51ee2e32533c49) --- lib/ansible/plugins/terminal/nxos.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/plugins/terminal/nxos.py b/lib/ansible/plugins/terminal/nxos.py index d2a3a3e37a6..b0b023d2c25 100644 --- a/lib/ansible/plugins/terminal/nxos.py +++ b/lib/ansible/plugins/terminal/nxos.py @@ -43,7 +43,8 @@ class TerminalModule(TerminalBase): re.compile(br"'[^']' +returned error code: ?\d+"), re.compile(br"syntax error"), re.compile(br"unknown command"), - re.compile(br"user not present") + re.compile(br"user not present"), + re.compile(br"invalid (.+?)at '\^' marker", re.I) ] def on_open_shell(self):