Fix Can't delete link between docker VM after they were in use

Fix #818
This commit is contained in:
Julien Duponchelle
2016-12-14 12:01:34 +01:00
parent 30f29d00c4
commit d0f65aebff
7 changed files with 30 additions and 25 deletions

View File

@ -1124,7 +1124,7 @@ class QemuVM(BaseNode):
raise QemuError('Adapter {adapter_number} does not exist on QEMU VM "{name}"'.format(name=self._name,
adapter_number=adapter_number))
if self.ubridge and self.ubridge.is_running():
if self.ubridge:
yield from self._add_ubridge_udp_connection("QEMU-{}-{}".format(self._id, adapter_number),
self._local_udp_tunnels[adapter_number][1],
nio)
@ -1153,7 +1153,7 @@ class QemuVM(BaseNode):
raise QemuError('Adapter {adapter_number} does not exist on QEMU VM "{name}"'.format(name=self._name,
adapter_number=adapter_number))
if self.ubridge and self.ubridge.is_running():
if self.ubridge:
yield from self._ubridge_send("bridge delete {name}".format(name="QEMU-{}-{}".format(self._id, adapter_number)))
elif self.is_running():
raise QemuError("Sorry, removing a link to a started Qemu VM is not supported without using uBridge.")
@ -1197,7 +1197,7 @@ class QemuVM(BaseNode):
nio.startPacketCapture(output_file)
if self.ubridge and self.ubridge.is_running():
if self.ubridge:
yield from self._ubridge_send('bridge start_capture {name} "{output_file}"'.format(name="QEMU-{}-{}".format(self._id, adapter_number),
output_file=output_file))
@ -1224,7 +1224,7 @@ class QemuVM(BaseNode):
nio.stopPacketCapture()
if self.ubridge and self.ubridge.is_running():
if self.ubridge:
yield from self._ubridge_send('bridge stop_capture {name}'.format(name="QEMU-{}-{}".format(self._id, adapter_number)))
log.info("QEMU VM '{name}' [{id}]: stopping packet capture on adapter {adapter_number}".format(name=self.name,