Cleanup openswitch

Also bump get_config in vyos, to pick up the addition of **kwargs

Closes #17415
pull/17525/head
Nathaniel Case 8 years ago committed by GitHub
parent 1e7e3aad0e
commit fcd4be28ee

@ -73,6 +73,7 @@ class Response(object):
except ValueError:
return None
class Rest(object):
DEFAULT_HEADERS = {
@ -221,7 +222,7 @@ class Cli(CliBase):
responses = self.execute(cmds)
return responses[1:]
def get_config(self):
def get_config(self, **kwargs):
return self.execute('show running-config')[0]
def load_config(self, commands, **kwargs):
@ -232,6 +233,7 @@ class Cli(CliBase):
Cli = register_transport('cli')(Cli)
class Ssh(object):
def __init__(self):
@ -239,6 +241,7 @@ class Ssh(object):
msg = 'ops.dc lib is required but does not appear to be available'
raise NetworkError(msg)
self._opsidl = None
self._extschema = None
def configure(self, config):
if not self._opsidl:

@ -259,7 +259,7 @@ class CliBase(object):
def configure(self, commands):
raise NotImplementedError
def get_config(self, commands):
def get_config(self, **kwargs):
raise NotImplementedError
def load_config(self, commands, **kwargs):

@ -29,7 +29,7 @@
import re
from ansible.module_utils.network import NetworkModule, NetworkError
from ansible.module_utils.network import register_transport, to_list, get_exception
from ansible.module_utils.network import register_transport, to_list
from ansible.module_utils.shell import CliBase
@ -96,7 +96,7 @@ class Cli(CliBase):
return diff
def get_config(self, output='text'):
def get_config(self, output='text', **kwargs):
if output not in ['text', 'set']:
raise ValueError('invalid output format specified')
if output == 'set':
@ -104,5 +104,4 @@ class Cli(CliBase):
else:
return self.execute(['show configuration'])[0]
Cli = register_transport('cli', default=True)(Cli)

Loading…
Cancel
Save