From 733e512f3524e4768aea610ee58b0331f1604f17 Mon Sep 17 00:00:00 2001 From: Ganesh Nalawade Date: Thu, 2 Aug 2018 09:44:30 +0530 Subject: [PATCH] Fix typo in cliconf get_config (#43553) --- lib/ansible/plugins/cliconf/__init__.py | 2 +- lib/ansible/plugins/cliconf/eos.py | 4 ++-- lib/ansible/plugins/cliconf/ios.py | 8 ++++---- lib/ansible/plugins/cliconf/nxos.py | 6 +++--- lib/ansible/plugins/cliconf/vyos.py | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/ansible/plugins/cliconf/__init__.py b/lib/ansible/plugins/cliconf/__init__.py index 9485daa5a89..da0855b656b 100644 --- a/lib/ansible/plugins/cliconf/__init__.py +++ b/lib/ansible/plugins/cliconf/__init__.py @@ -165,7 +165,7 @@ class CliconfBase(AnsiblePlugin): self.response_logging = False @abstractmethod - def get_config(self, source='running', flag=None, format=None): + def get_config(self, source='running', flags=None, format=None): """Retrieves the specified configuration from the device This method will retrieve the configuration specified by source and diff --git a/lib/ansible/plugins/cliconf/eos.py b/lib/ansible/plugins/cliconf/eos.py index ce1cd219e67..f5ce7a8a9d3 100644 --- a/lib/ansible/plugins/cliconf/eos.py +++ b/lib/ansible/plugins/cliconf/eos.py @@ -75,7 +75,7 @@ class Cliconf(CliconfBase): return resp @enable_mode - def get_config(self, source='running', format='text', flag=None): + def get_config(self, source='running', format='text', flags=None): options_values = self.get_option_values() if format not in options_values['format']: raise ValueError("'format' value %s is invalid. Valid values are %s" % (format, ','.join(options_values['format']))) @@ -88,7 +88,7 @@ class Cliconf(CliconfBase): if format and format is not 'text': cmd += '| %s ' % format - cmd += ' '.join(to_list(flag)) + cmd += ' '.join(to_list(flags)) cmd = cmd.strip() return self.send_command(cmd) diff --git a/lib/ansible/plugins/cliconf/ios.py b/lib/ansible/plugins/cliconf/ios.py index bd97bb4ed91..13197f3b5e1 100644 --- a/lib/ansible/plugins/cliconf/ios.py +++ b/lib/ansible/plugins/cliconf/ios.py @@ -37,21 +37,21 @@ from ansible.plugins.cliconf import CliconfBase, enable_mode class Cliconf(CliconfBase): @enable_mode - def get_config(self, source='running', flag=None, format=None): + def get_config(self, source='running', flags=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 flag: - flag = [] + if not flags: + flags = [] if source == 'running': cmd = 'show running-config ' else: cmd = 'show startup-config ' - cmd += ' '.join(to_list(flag)) + cmd += ' '.join(to_list(flags)) cmd = cmd.strip() return self.send_command(cmd) diff --git a/lib/ansible/plugins/cliconf/nxos.py b/lib/ansible/plugins/cliconf/nxos.py index 2d072b009b5..2c936cf1447 100644 --- a/lib/ansible/plugins/cliconf/nxos.py +++ b/lib/ansible/plugins/cliconf/nxos.py @@ -131,7 +131,7 @@ class Cliconf(CliconfBase): diff['config_diff'] = dumps(configdiffobjs, 'commands') if configdiffobjs else '' return diff - def get_config(self, source='running', format='text', flag=None): + def get_config(self, source='running', format='text', flags=None): options_values = self.get_option_values() if format not in options_values['format']: raise ValueError("'format' value %s is invalid. Valid values are %s" % (format, ','.join(options_values['format']))) @@ -144,8 +144,8 @@ class Cliconf(CliconfBase): if format and format is not 'text': cmd += '| %s ' % format - if flag: - cmd += ' '.join(to_list(flag)) + if flags: + cmd += ' '.join(to_list(flags)) cmd = cmd.strip() return self.send_command(cmd) diff --git a/lib/ansible/plugins/cliconf/vyos.py b/lib/ansible/plugins/cliconf/vyos.py index 746974cf477..18c068f39e1 100644 --- a/lib/ansible/plugins/cliconf/vyos.py +++ b/lib/ansible/plugins/cliconf/vyos.py @@ -54,7 +54,7 @@ class Cliconf(CliconfBase): return device_info - def get_config(self, flag=None, format=None): + def get_config(self, flags=None, format=None): if format: option_values = self.get_option_values() if format not in option_values['format']: