From fdd1084714f34b8d43031126040c9f82727d1891 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Mon, 10 Apr 2017 16:58:00 +0200 Subject: [PATCH] Fix bridge 'bridge0' already exist when we have trouble with a container Fix #973 --- gns3server/compute/docker/docker_vm.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gns3server/compute/docker/docker_vm.py b/gns3server/compute/docker/docker_vm.py index 0ac110ac..c8ebd66f 100644 --- a/gns3server/compute/docker/docker_vm.py +++ b/gns3server/compute/docker/docker_vm.py @@ -361,6 +361,7 @@ class DockerVM(BaseNode): try: yield from self._add_ubridge_connection(nio, adapter_number) except UbridgeNamespaceError: + log.error("Container {} failed to start", self.name) yield from self.stop() # The container can crash soon after the start, this means we can not move the interface to the container namespace @@ -517,6 +518,8 @@ class DockerVM(BaseNode): state = yield from self._get_container_state() if state == "running": return True + if self.status == "started": # The container crashed we need to clean + yield from self.stop() return False @asyncio.coroutine