mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 05:12:45 +00: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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user