Serialize NIO

This commit is contained in:
Julien Duponchelle committed 2015-01-16 17:09:45 +01:00
1 parent 0cdc1c3042
commit bf6f62e629
11 files changed
+65 -26

No files matched your search

+3
View File
@@ -44,3 +44,6 @@ class NIO_TAP(object):
def __str__(self):
return "NIO TAP"
def __json__(self):
return {"type": "nio_tap", "tap_device": self._tap_device}
+3
View File
@@ -70,3 +70,6 @@ class NIO_UDP(object):
def __str__(self):
return "NIO UDP"
def __json__(self):
return {"type": "nio_udp", "lport": self._lport, "rport": self._rport, "rhost": self._rhost}
-1
View File
@@ -265,7 +265,6 @@ class VPCSDevice(BaseVM):
nio = NIO_UDP(lport, rhost, rport)
elif nio_settings["type"] == "nio_tap":
tap_device = nio_settings["tap_device"]
print(has_privileged_access)
if not has_privileged_access(self._path):
raise VPCSError("{} has no privileged access to {}.".format(self._path, tap_device))
nio = NIO_TAP(tap_device)