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

Fix VPCS ubridge usage

This commit is contained in:
Julien Duponchelle 2017-07-12 09:55:23 +02:00
parent d112da400e
commit 04303ca00c
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8

View File

@ -374,9 +374,7 @@ class VPCSVM(BaseNode):
raise VPCSError("Port {port_number} doesn't exist in adapter {adapter}".format(adapter=self._ethernet_adapter,
port_number=port_number))
if not self._local_udp_tunnel:
self._local_udp_tunnel = self._create_local_udp_tunnel()
if self.is_running():
yield from self.add_ubridge_udp_connection("VPCS-{}".format(self._id), self._local_udp_tunnel[1], nio)
self._ethernet_adapter.add_nio(port_number, nio)
@ -392,8 +390,7 @@ class VPCSVM(BaseNode):
if not self._ethernet_adapter.port_exists(port_number):
raise VPCSError("Port {port_number} doesn't exist in adapter {adapter}".format(adapter=self._ethernet_adapter,
port_number=port_number))
if not self._local_udp_tunnel:
self._local_udp_tunnel = self._create_local_udp_tunnel()
if self.is_running():
yield from self._update_ubridge_udp_connection("VPCS-{}".format(self._id), self._local_udp_tunnel[1], nio)
@asyncio.coroutine
@ -410,6 +407,7 @@ class VPCSVM(BaseNode):
raise VPCSError("Port {port_number} doesn't exist in adapter {adapter}".format(adapter=self._ethernet_adapter,
port_number=port_number))
if self.is_running():
yield from self._ubridge_send("bridge delete {name}".format(name="VPCS-{}".format(self._id)))
nio = self._ethernet_adapter.get_nio(port_number)