1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-12-29 02:08:10 +00:00

Catch a race condition in VirtualBox when editing and linking

Fix #993
This commit is contained in:
Julien Duponchelle 2017-05-03 16:14:42 +02:00
parent 078a6d8d34
commit 31d1696215
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8

View File

@ -968,9 +968,13 @@ class VirtualBoxVM(BaseNode):
adapter_number=adapter_number))
if self.ubridge:
yield from self._add_ubridge_udp_connection("VBOX-{}-{}".format(self._id, adapter_number),
self._local_udp_tunnels[adapter_number][1],
nio)
try:
yield from self._add_ubridge_udp_connection("VBOX-{}-{}".format(self._id, adapter_number),
self._local_udp_tunnels[adapter_number][1],
nio)
except KeyError:
raise VirtualBoxError("Adapter {adapter_number} doesn't exist on VirtualBox VM '{name}'".format(name=self.name,
adapter_number=adapter_number))
yield from self._control_vm("setlinkstate{} on".format(adapter_number + 1))
else:
vm_state = yield from self._get_vm_state()