From 5036bba2e0e47c9dd07fdaf8e4c8fd41d541b014 Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Thu, 25 Aug 2016 22:10:00 -0400 Subject: [PATCH] implements command_string property when preparing commands * commands that need | json added now use command_string property * adds additonal keyword args in exception handling for json commands --- lib/ansible/module_utils/nxos.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/module_utils/nxos.py b/lib/ansible/module_utils/nxos.py index 32dfd9be263..0378b14954b 100644 --- a/lib/ansible/module_utils/nxos.py +++ b/lib/ansible/module_utils/nxos.py @@ -251,7 +251,7 @@ class Cli(CliBase): except ValueError: raise NetworkError( msg='unable to load response from device', - response=responses[index] + response=responses[index], command=str(cmd) ) return responses @@ -287,5 +287,5 @@ def prepare_commands(commands): jsonify = lambda x: '%s | json' % x for cmd in to_list(commands): if cmd.output == 'json': - cmd.command = jsonify(cmd) + cmd.command_string = jsonify(cmd) yield cmd