Update cliconf get_config api (#43472)

*  Change `filter` parameter to `flag` to be in sync
   with original naming convention
This commit is contained in:
Ganesh Nalawade 2018-07-31 02:53:29 -07:00 committed by GitHub
parent c8fcbdef71
commit 857200fa7f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 15 additions and 15 deletions

View file

@ -37,21 +37,21 @@ from ansible.plugins.cliconf import CliconfBase, enable_mode
class Cliconf(CliconfBase):
@enable_mode
def get_config(self, source='running', filter=None, format=None):
def get_config(self, source='running', flag=None, format=None):
if source not in ('running', 'startup'):
return self.invalid_params("fetching configuration from %s is not supported" % source)
if format:
raise ValueError("'format' value %s is not supported for get_config" % format)
if not filter:
filter = []
if not flag:
flag = []
if source == 'running':
cmd = 'show running-config '
else:
cmd = 'show startup-config '
cmd += ' '.join(to_list(filter))
cmd += ' '.join(to_list(flag))
cmd = cmd.strip()
return self.send_command(cmd)