mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 14:01:15 +02:00
Serialize NIO
This commit is contained in:
1 parent
0cdc1c3042
commit
bf6f62e629
11 files changed
+65
-26
No files matched your search
@@ -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}
|
||||
@@ -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}
|
||||
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user