From eb5e15e7e0dc60d53aea6370d9a45a47e3632b2e Mon Sep 17 00:00:00 2001 From: Ganesh Nalawade Date: Wed, 2 May 2018 19:27:56 +0530 Subject: [PATCH] Fix fetching ios default running config (#39475) If default option is enable in that case only add 'all' or 'full' flag --- lib/ansible/plugins/cliconf/ios.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/ansible/plugins/cliconf/ios.py b/lib/ansible/plugins/cliconf/ios.py index 71a8b98fc4..a638d305e6 100644 --- a/lib/ansible/plugins/cliconf/ios.py +++ b/lib/ansible/plugins/cliconf/ios.py @@ -56,12 +56,14 @@ class Cliconf(CliconfBase): def get_config(self, source='running', format='text', flags=None): if source not in ('running', 'startup'): return self.invalid_params("fetching configuration from %s is not supported" % source) + + if not flags: + flags = [] + if source == 'running': cmd = 'show running-config ' - if not flags: - flags = ['all'] else: - cmd = 'show startup-config' + cmd = 'show startup-config ' cmd += ' '.join(to_list(flags)) cmd = cmd.strip()