From bbdbc971c0977fe59e79aab6bd8697dde427e19b Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Wed, 24 Feb 2016 15:04:45 +0100 Subject: [PATCH] Fix Exception on removal of Docker VM Fix #441 --- gns3server/modules/docker/docker_vm.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gns3server/modules/docker/docker_vm.py b/gns3server/modules/docker/docker_vm.py index 2bf6872a..31b9766c 100644 --- a/gns3server/modules/docker/docker_vm.py +++ b/gns3server/modules/docker/docker_vm.py @@ -454,6 +454,9 @@ class DockerVM(BaseVM): :param adapter_number: adapter number """ + if not self._ubridge_hypervisor: + return + yield from self._ubridge_hypervisor.send("bridge delete bridge{name}".format( name=adapter_number)) @@ -504,8 +507,7 @@ class DockerVM(BaseVM): name=self.name, adapter_number=adapter_number)) adapter.remove_nio(0) - if not self._ubridge_hypervisor: - yield from self._delete_ubridge_connection(adapter_number) + yield from self._delete_ubridge_connection(adapter_number) log.info( "Docker VM '{name}' [{id}]: {nio} removed from adapter {adapter_number}".format(