mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-08 17:34:01 -07:00
Add fetching default filter in ios cliconf plugin (#42339)
* Add capability to fetch default filter flag in ios cliconf plugin.
This commit is contained in:
parent
f7dbf581b1
commit
75382814f0
2 changed files with 22 additions and 13 deletions
|
@ -93,18 +93,8 @@ def check_args(module, warnings):
|
|||
|
||||
def get_defaults_flag(module):
|
||||
connection = get_connection(module)
|
||||
out = connection.get('show running-config ?')
|
||||
out = to_text(out, errors='surrogate_then_replace')
|
||||
|
||||
commands = set()
|
||||
for line in out.splitlines():
|
||||
if line.strip():
|
||||
commands.add(line.strip().split()[0])
|
||||
|
||||
if 'all' in commands:
|
||||
return ['all']
|
||||
else:
|
||||
return ['full']
|
||||
out = connection.get_defaults_flag()
|
||||
return to_text(out, errors='surrogate_then_replace').strip()
|
||||
|
||||
|
||||
def get_config(module, flags=None):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue