1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-18 06:18:08 +00:00

Allows the creation of non-existent TAP interfaces when using the cloud.

This commit is contained in:
grossmj 2016-06-23 11:36:32 -06:00
parent c8f37381f4
commit 4eb03b5a99

View File

@ -162,9 +162,6 @@ class Cloud(BaseNode):
rport=nio.rport))
if port_info["type"] in ("ethernet", "tap"):
network_interfaces = [interface["name"] for interface in interfaces()]
if not port_info["interface"] in network_interfaces:
raise NodeError("Interface '{}' could not be found on this system".format(port_info["interface"]))
if sys.platform.startswith("win"):
windows_interfaces = interfaces()
@ -181,6 +178,10 @@ class Cloud(BaseNode):
else:
if port_info["type"] == "ethernet":
network_interfaces = [interface["name"] for interface in interfaces()]
if not port_info["interface"] in network_interfaces:
raise NodeError("Interface '{}' could not be found on this system".format(port_info["interface"]))
if sys.platform.startswith("linux"):
# use raw sockets on Linux
yield from self._ubridge_send('bridge add_nio_linux_raw {name} "{interface}"'.format(name=bridge_name,