Network Module: EOS (#16158)

* add new module network

* move EOS to NetworkModule

* shell.py Python 3.x compatibility

* implements the Command class through the connection for eos

This implements a new Command class that specifies the cli command
and output format.  This removes the need to batch commands through
the connection

* initial add of netcmd module
This commit is contained in:
Nathaniel Case 2016-06-20 12:11:48 -04:00 committed by GitHub
parent 17447ff035
commit 5dccff29bf
5 changed files with 933 additions and 335 deletions

View file

@ -19,6 +19,8 @@
import re
import socket
from ansible.module_utils.basic import get_exception
# py2 vs py3; replace with six via ziploader
try:
from StringIO import StringIO
@ -156,6 +158,9 @@ class Shell(object):
responses.append(self.receive(command))
except socket.timeout:
raise ShellError("timeout trying to send command", cmd)
except socket.error:
exc = get_exception()
raise ShellError("problem sending command to host: %s" % exc.message)
return responses
def close(self):