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

Cleanup eos (#17548)

This commit is contained in:
Nathaniel Case 2016-09-13 14:29:06 -04:00 committed by GitHub
parent e9ffe2062f
commit 5331dd482c

View file

@ -35,7 +35,6 @@ from ansible.module_utils.network import add_argument, register_transport, to_li
from ansible.module_utils.netcli import Command from ansible.module_utils.netcli import Command
from ansible.module_utils.shell import CliBase from ansible.module_utils.shell import CliBase
from ansible.module_utils.urls import fetch_url, url_argument_spec from ansible.module_utils.urls import fetch_url, url_argument_spec
from ansible.module_utils.netcli import Command
EAPI_FORMATS = ['json', 'text'] EAPI_FORMATS = ['json', 'text']
@ -112,6 +111,7 @@ class EosConfigMixin(object):
commands = ['configure session %s' % session, 'abort'] commands = ['configure session %s' % session, 'abort']
self.execute(commands) self.execute(commands)
class Eapi(EosConfigMixin): class Eapi(EosConfigMixin):
def __init__(self): def __init__(self):
@ -178,8 +178,8 @@ class Eapi(EosConfigMixin):
if self.enable is not None: if self.enable is not None:
commands.insert(0, self.enable) commands.insert(0, self.enable)
data = self._get_body(commands, output) body = self._get_body(commands, output)
data = json.dumps(data) data = json.dumps(body)
headers = {'Content-Type': 'application/json-rpc'} headers = {'Content-Type': 'application/json-rpc'}
@ -208,7 +208,6 @@ class Eapi(EosConfigMixin):
return response['result'] return response['result']
def run_commands(self, commands, **kwargs): def run_commands(self, commands, **kwargs):
output = None output = None
cmds = list() cmds = list()