Handle startup-config push using base64

Dynamips working directory management
Random port selection for the ZeroMQ server
TCP & UDP port allocation in a range with improvements
Update Dynamips to 0.2.11 (for the tests)
Focus on Python3 development (stop trying to be compatible with Python
2.x)
More error/bug catching
This commit is contained in:
grossmj committed 2014-03-02 15:20:03 -07:00
1 parent 687d5b75ab
commit 89888ae7bf
25 files changed
+349 -137

No files matched your search

+9 -2
View File
@@ -49,9 +49,16 @@ class Server(object):
self._host = host
self._port = port
if ipc:
self._zmq_port = 0 # this forces module to use IPC for communications
self._zmq_port = 0 # this forces to use IPC for communications with the ZeroMQ server
else:
self._zmq_port = port + 1 # this server port + 1
try:
# let the OS find an unused port for the ZeroMQ server
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
sock.bind(('127.0.0.1', 0))
self._zmq_port = sock.getsockname()[1]
except socket.error as e:
log.warn("could not pick up a random port for the ZeroMQ server: {}".format(e))
self._zmq_port = port + 1 # let's try this server port + 1
self._ipc = ipc
self._modules = []