1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

changes nxos method for passing kwargs to get_config()

This change makes both the Cli and Nxapi objects handle the get_config()
method consistently the same
This commit is contained in:
Peter Sprygada 2016-08-28 23:02:36 -04:00
parent 4b679ffd84
commit 2cb2ba1fe6

View file

@ -173,17 +173,15 @@ class Nxapi(object):
return responses return responses
### end of netcli.Cli ###
### implemention of netcfg.Config ### ### implemention of netcfg.Config ###
def configure(self, commands): def configure(self, commands):
commands = to_list(commands) commands = to_list(commands)
return self.execute(commands, output='config') return self.execute(commands, output='config')
def get_config(self, **kwargs): def get_config(self, include_defaults=False):
cmd = 'show running-config' cmd = 'show running-config'
if kwargs.get('include_defaults'): if include_defaults:
cmd += ' all' cmd += ' all'
return self.execute([cmd], output='text')[0] return self.execute([cmd], output='text')[0]
@ -263,9 +261,9 @@ class Cli(CliBase):
responses.pop(0) responses.pop(0)
return responses return responses
def get_config(self, include_defaults=False, **kwargs): def get_config(self, include_defaults=False):
cmd = 'show running-config' cmd = 'show running-config'
if kwargs.get('include_defaults'): if include_defaults:
cmd += ' all' cmd += ' all'
return self.execute([cmd])[0] return self.execute([cmd])[0]