From e464599632340f247c593f2db770be9782f7dec5 Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Tue, 6 Sep 2016 22:51:40 -0400 Subject: [PATCH] minor bug fixes in eos_template * fixes issue where configuration was not being loaded (#4704) * fixes issue where defaults were not included when argument was set to True tested on EOS 4.15.4F --- network/eos/eos_template.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/network/eos/eos_template.py b/network/eos/eos_template.py index c5361876598..59733ab5931 100644 --- a/network/eos/eos_template.py +++ b/network/eos/eos_template.py @@ -122,8 +122,9 @@ from ansible.module_utils.eos import NetworkModule def get_config(module): config = module.params.get('config') + defaults = module.params['include_defaults'] if not config and not module.params['force']: - config = module.config.get_config() + config = module.config.get_config(include_defaults=defaults) return config def filter_exit(commands): @@ -198,7 +199,12 @@ def main(): commands = filter_exit(commands) if commands: if not module.check_mode: - response = module.config(commands, replace=replace) + response = module.config.load_config(commands, + replace=replace, + session='eos_template', + commit=True) + + module.cli('no configure session eos_template') result['responses'] = response result['changed'] = True