From b0cd624aef549989895dafbab95e97165922119f Mon Sep 17 00:00:00 2001 From: Peter Sprygada <privateip@users.noreply.github.com> Date: Sun, 2 Oct 2016 16:47:22 -0400 Subject: [PATCH] fixes issue with run_commands raising error (#17861) The junos run_commands() method should raise an error when an RpcError is returned but didn't when using display=text. This fixes that error --- lib/ansible/module_utils/junos.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ansible/module_utils/junos.py b/lib/ansible/module_utils/junos.py index 730839bbd5c..7fe6650015b 100644 --- a/lib/ansible/module_utils/junos.py +++ b/lib/ansible/module_utils/junos.py @@ -139,6 +139,9 @@ class Netconf(object): responses[index] = xml_to_json(responses[index]) elif cmd.args.get('command_type') == 'rpc': responses[index] = str(responses[index].text).strip() + elif 'RpcError' in responses[index]: + raise NetworkError(responses[index]) + return responses