diff options
Diffstat (limited to 'lib/ansible/module_utils/ios.py')
-rw-r--r-- | lib/ansible/module_utils/ios.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/ansible/module_utils/ios.py b/lib/ansible/module_utils/ios.py index 38412f6eaf..480c8f9880 100644 --- a/lib/ansible/module_utils/ios.py +++ b/lib/ansible/module_utils/ios.py @@ -50,6 +50,16 @@ def check_args(module, warnings): warnings.append('argument %s has been deprecated and will be ' 'removed in a future version' % key) +def get_defaults_flag(module): + rc, out, err = exec_command(module, 'show running-config ?') + + commands = set() + for line in out.splitlines(): + if line: + commands.add(line.strip().split()[0]) + + return 'all' if 'all' in commands else 'full' + def get_config(module, flags=[]): cmd = 'show running-config ' cmd += ' '.join(flags) |