From 70f315b7a4e73674491c01431695910a2201d3c2 Mon Sep 17 00:00:00 2001 From: b-abadie <1434660+b-abadie@users.noreply.github.com> Date: Wed, 3 Apr 2019 07:01:11 +0200 Subject: [PATCH] network, eos_config: when the config session show no diff, set 'changed' to False (#54678) --- lib/ansible/modules/network/eos/eos_config.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/ansible/modules/network/eos/eos_config.py b/lib/ansible/modules/network/eos/eos_config.py index cf40a78d131..1bbd5d1e398 100644 --- a/lib/ansible/modules/network/eos/eos_config.py +++ b/lib/ansible/modules/network/eos/eos_config.py @@ -435,14 +435,17 @@ def main(): response = load_config(module, commands, replace=replace, commit=commit) - if 'diff' in response and module.params['diff_against'] == 'session': - result['diff'] = {'prepared': response['diff']} + result['changed'] = True + + if module.params['diff_against'] == 'session': + if 'diff' in response: + result['diff'] = {'prepared': response['diff']} + else: + result['changed'] = False if 'session' in response: result['session'] = response['session'] - result['changed'] = True - running_config = module.params['running_config'] startup_config = None