mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 20:01:25 -07:00
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:
parent
17447ff035
commit
5dccff29bf
5 changed files with 933 additions and 335 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue