mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-24 17:28:08 +00:00
Fix VPCS ubridge usage
This commit is contained in:
parent
d112da400e
commit
04303ca00c
@ -374,9 +374,7 @@ class VPCSVM(BaseNode):
|
|||||||
raise VPCSError("Port {port_number} doesn't exist in adapter {adapter}".format(adapter=self._ethernet_adapter,
|
raise VPCSError("Port {port_number} doesn't exist in adapter {adapter}".format(adapter=self._ethernet_adapter,
|
||||||
port_number=port_number))
|
port_number=port_number))
|
||||||
|
|
||||||
if not self._local_udp_tunnel:
|
if self.is_running():
|
||||||
self._local_udp_tunnel = self._create_local_udp_tunnel()
|
|
||||||
|
|
||||||
yield from self.add_ubridge_udp_connection("VPCS-{}".format(self._id), self._local_udp_tunnel[1], nio)
|
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)
|
self._ethernet_adapter.add_nio(port_number, nio)
|
||||||
@ -392,8 +390,7 @@ class VPCSVM(BaseNode):
|
|||||||
if not self._ethernet_adapter.port_exists(port_number):
|
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,
|
raise VPCSError("Port {port_number} doesn't exist in adapter {adapter}".format(adapter=self._ethernet_adapter,
|
||||||
port_number=port_number))
|
port_number=port_number))
|
||||||
if not self._local_udp_tunnel:
|
if self.is_running():
|
||||||
self._local_udp_tunnel = self._create_local_udp_tunnel()
|
|
||||||
yield from self._update_ubridge_udp_connection("VPCS-{}".format(self._id), self._local_udp_tunnel[1], nio)
|
yield from self._update_ubridge_udp_connection("VPCS-{}".format(self._id), self._local_udp_tunnel[1], nio)
|
||||||
|
|
||||||
@asyncio.coroutine
|
@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,
|
raise VPCSError("Port {port_number} doesn't exist in adapter {adapter}".format(adapter=self._ethernet_adapter,
|
||||||
port_number=port_number))
|
port_number=port_number))
|
||||||
|
|
||||||
|
if self.is_running():
|
||||||
yield from self._ubridge_send("bridge delete {name}".format(name="VPCS-{}".format(self._id)))
|
yield from self._ubridge_send("bridge delete {name}".format(name="VPCS-{}".format(self._id)))
|
||||||
|
|
||||||
nio = self._ethernet_adapter.get_nio(port_number)
|
nio = self._ethernet_adapter.get_nio(port_number)
|
||||||
|
Loading…
Reference in New Issue
Block a user