mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 03:11:24 -07:00
Fix dangerous default args. (#29839)
This commit is contained in:
parent
5caa47feb9
commit
68aeaa58a8
50 changed files with 253 additions and 87 deletions
|
@ -116,9 +116,11 @@ class Cli:
|
|||
command = self._module.jsonify(command)
|
||||
return exec_command(self._module, command)
|
||||
|
||||
def get_config(self, flags=[]):
|
||||
def get_config(self, flags=None):
|
||||
"""Retrieves the current config from the device or cache
|
||||
"""
|
||||
flags = [] if flags is None else []
|
||||
|
||||
cmd = 'show running-config '
|
||||
cmd += ' '.join(flags)
|
||||
cmd = cmd.strip()
|
||||
|
@ -299,9 +301,11 @@ class Nxapi:
|
|||
|
||||
return result
|
||||
|
||||
def get_config(self, flags=[]):
|
||||
def get_config(self, flags=None):
|
||||
"""Retrieves the current config from the device or cache
|
||||
"""
|
||||
flags = [] if flags is None else flags
|
||||
|
||||
cmd = 'show running-config '
|
||||
cmd += ' '.join(flags)
|
||||
cmd = cmd.strip()
|
||||
|
@ -385,7 +389,9 @@ def to_command(module, commands):
|
|||
return commands
|
||||
|
||||
|
||||
def get_config(module, flags=[]):
|
||||
def get_config(module, flags=None):
|
||||
flags = [] if flags is None else flags
|
||||
|
||||
conn = get_connection(module)
|
||||
return conn.get_config(flags)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue