From ec3660c97929d30503bf6ac2ac59c3596d523c42 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Fri, 14 Oct 2016 19:06:12 +0200 Subject: [PATCH] Catch an error when docker is not running --- gns3server/compute/docker/docker_vm.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gns3server/compute/docker/docker_vm.py b/gns3server/compute/docker/docker_vm.py index ee97fdf1..abbd4598 100644 --- a/gns3server/compute/docker/docker_vm.py +++ b/gns3server/compute/docker/docker_vm.py @@ -603,7 +603,10 @@ class DockerVM(BaseNode): pass # v – 1/True/true or 0/False/false, Remove the volumes associated to the container. Default false. # force - 1/True/true or 0/False/false, Kill then remove the container. Default false. - yield from self.manager.query("DELETE", "containers/{}".format(self._cid), params={"force": 1, "v": 1}) + try: + yield from self.manager.query("DELETE", "containers/{}".format(self._cid), params={"force": 1, "v": 1}) + except DockerError: + pass log.info("Docker container '{name}' [{image}] removed".format( name=self._name, image=self._image))