From 730bd682c6f2ce553fa59b342b6382d079698410 Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Wed, 22 Feb 2017 22:41:14 -0500 Subject: [PATCH] sends save command in text mode otherwise it fails (#21812) Sending the save command over nxapi requires text mode otherwise nxapi will reject the command. This commit ensures that the command is always sent in text mode fixes #18971 --- lib/ansible/modules/network/nxos/nxos_config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/network/nxos/nxos_config.py b/lib/ansible/modules/network/nxos/nxos_config.py index 5987e33d329..44ceba333fe 100644 --- a/lib/ansible/modules/network/nxos/nxos_config.py +++ b/lib/ansible/modules/network/nxos/nxos_config.py @@ -332,7 +332,8 @@ def main(): if module.params['save']: if not module.check_mode: - run_commands(module, ['copy running-config startup-config']) + cmd = {'command': 'copy running-config startup-config', 'output': 'text'} + run_commands(module, [cmd]) result['changed'] = True module.exit_json(**result)