Dynamips NIO connections.

This commit is contained in:
Jeremy
2015-02-13 15:11:14 -07:00
parent 83edc649d2
commit a5ac7c5481
18 changed files with 515 additions and 270 deletions

View File

@ -40,14 +40,13 @@ class NIOUNIX(NIO):
def __init__(self, hypervisor, local_file, remote_file):
NIO.__init__(self, hypervisor)
# create an unique ID
self._id = NIOUNIX._instance_count
# create an unique ID and name
nio_id = NIOUNIX._instance_count
NIOUNIX._instance_count += 1
self._name = 'nio_unix' + str(self._id)
name = 'nio_unix' + str(nio_id)
self._local_file = local_file
self._remote_file = remote_file
NIO.__init__(self, name, hypervisor)
@classmethod
def reset(cls):
@ -87,3 +86,9 @@ class NIOUNIX(NIO):
"""
return self._remote_file
def __json__(self):
return {"type": "nio_unix",
"local_file": self._local_file,
"remote_file": self._remote_file}