From 8333a8b90882e364216c499aed7c69274c4d984b Mon Sep 17 00:00:00 2001 From: Ricardo Carrillo Cruz Date: Fri, 14 Jul 2017 13:43:17 +0200 Subject: [PATCH] Fix eos_config defaults logic (#26798) Current code is bogus, it was passing flags all unconditionally. --- lib/ansible/modules/network/eos/eos_config.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/network/eos/eos_config.py b/lib/ansible/modules/network/eos/eos_config.py index 3cb2cc5f8f7..3787dd55c9f 100644 --- a/lib/ansible/modules/network/eos/eos_config.py +++ b/lib/ansible/modules/network/eos/eos_config.py @@ -288,10 +288,12 @@ def get_candidate(module): def get_running_config(module, config=None): contents = module.params['running_config'] if not contents: - if not module.params['defaults'] and config: + if config: contents = config else: - flags = ['all'] + flags = [] + if module.params['defaults']: + flags.append('all') contents = get_config(module, flags=flags) return NetworkConfig(indent=3, contents=contents)