From 005233f814f922e13624b70cc381e9cede49bec2 Mon Sep 17 00:00:00 2001 From: Ganesh Nalawade Date: Fri, 31 Aug 2018 19:57:38 +0530 Subject: [PATCH] Fix iosxr_config integration test failure (#44969) * Check for commands presence in case running config is used as base config for diff * Correct the fixtures --- lib/ansible/modules/network/iosxr/iosxr_config.py | 2 +- .../targets/iosxr_config/fixtures/config_add_interface.txt | 2 ++ .../targets/iosxr_config/fixtures/config_del_interface.txt | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/network/iosxr/iosxr_config.py b/lib/ansible/modules/network/iosxr/iosxr_config.py index bd8ec2268cc..9cd4043ee72 100644 --- a/lib/ansible/modules/network/iosxr/iosxr_config.py +++ b/lib/ansible/modules/network/iosxr/iosxr_config.py @@ -284,7 +284,7 @@ def run(module, result): commands = ['load harddisk:/ansible_config.txt'] replace_file_path = 'harddisk:/ansible_config.txt' - if config_diff: + if config_diff or commands: if not replace_config: commands = config_diff.split('\n') diff --git a/test/integration/targets/iosxr_config/fixtures/config_add_interface.txt b/test/integration/targets/iosxr_config/fixtures/config_add_interface.txt index 02bfb160dfa..4aca2814466 100644 --- a/test/integration/targets/iosxr_config/fixtures/config_add_interface.txt +++ b/test/integration/targets/iosxr_config/fixtures/config_add_interface.txt @@ -31,3 +31,5 @@ netconf-yang agent ! ssh server v2 ssh server netconf vrf default +! +end diff --git a/test/integration/targets/iosxr_config/fixtures/config_del_interface.txt b/test/integration/targets/iosxr_config/fixtures/config_del_interface.txt index 42a1d74e7b1..a35e4da75a0 100644 --- a/test/integration/targets/iosxr_config/fixtures/config_del_interface.txt +++ b/test/integration/targets/iosxr_config/fixtures/config_del_interface.txt @@ -25,3 +25,5 @@ netconf-yang agent ! ssh server v2 ssh server netconf vrf default +! +end