From 979f1e5ed14fd13c95b3651906c4916b5bb01535 Mon Sep 17 00:00:00 2001 From: Trishna Guha Date: Wed, 16 May 2018 14:59:23 +0530 Subject: [PATCH] save_snapshot_locally nxos_snapshot (#40227) Signed-off-by: Trishna Guha --- lib/ansible/modules/network/nxos/nxos_snapshot.py | 2 +- test/integration/targets/nxos_snapshot/tests/common/sanity.yaml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/network/nxos/nxos_snapshot.py b/lib/ansible/modules/network/nxos/nxos_snapshot.py index 7f32e3cf61c..be0e3e13687 100644 --- a/lib/ansible/modules/network/nxos/nxos_snapshot.py +++ b/lib/ansible/modules/network/nxos/nxos_snapshot.py @@ -372,7 +372,7 @@ def main(): result['commands'] = action_results result['changed'] = True - if action == 'create' and module.params['path']: + if action == 'create' and module.params['path'] and module.params['save_snapshot_locally']: command = 'show snapshot | include {}'.format(module.params['snapshot_name']) content = execute_show_command(command, module)[0] if content: diff --git a/test/integration/targets/nxos_snapshot/tests/common/sanity.yaml b/test/integration/targets/nxos_snapshot/tests/common/sanity.yaml index 4f1e18f640c..5220d8d56e5 100644 --- a/test/integration/targets/nxos_snapshot/tests/common/sanity.yaml +++ b/test/integration/targets/nxos_snapshot/tests/common/sanity.yaml @@ -13,6 +13,7 @@ action: create snapshot_name: test_snapshot1 description: Ansible + save_snapshot_locally: true provider: "{{ connection }}" - name: create another snapshot @@ -24,6 +25,7 @@ show_command: show ip interface brief row_id: ROW_intf element_key1: intf-name + save_snapshot_locally: true provider: "{{ connection }}" - name: compare snapshots