From 07b982d4dbde6c7d59c85f3c3adb24938a8cbd5b Mon Sep 17 00:00:00 2001 From: Bernhard Ehlers Date: Thu, 1 Sep 2016 09:28:22 +0200 Subject: [PATCH 1/3] Fix when closing a container using VNC, root permission are not reset Fix #659 Signed-off-by: Julien Duponchelle --- gns3server/modules/docker/docker_vm.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gns3server/modules/docker/docker_vm.py b/gns3server/modules/docker/docker_vm.py index 386d73e9..680b150b 100644 --- a/gns3server/modules/docker/docker_vm.py +++ b/gns3server/modules/docker/docker_vm.py @@ -577,6 +577,9 @@ class DockerVM(BaseVM): @asyncio.coroutine def reset(self): try: + state = yield from self._get_container_state() + if state == "paused" or state == "running": + yield from self.stop() if self.console_type == "vnc": if self._x11vnc_process: try: @@ -589,9 +592,6 @@ class DockerVM(BaseVM): yield from self._xvfb_process.wait() except ProcessLookupError: pass - state = yield from self._get_container_state() - if state == "paused" or state == "running": - yield from self.stop() # 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}) @@ -658,7 +658,7 @@ class DockerVM(BaseVM): if nio.capturing: yield from self._ubridge_hypervisor.send('bridge start_capture bridge{adapter} "{pcap_file}"'.format(adapter=adapter_number, - pcap_file=nio.pcap_output_file)) + pcap_file=nio.pcap_output_file)) yield from self._ubridge_hypervisor.send('bridge start bridge{adapter}'.format(adapter=adapter_number)) From a7be4681d5616a06ddebedf4c0f73859fbf36597 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Tue, 6 Sep 2016 09:45:29 +0200 Subject: [PATCH 2/3] Create gns3server/symbols directory This directory is use only in 2.0 but to simplify packaging we create it in 1.5. --- gns3server/symbols/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 gns3server/symbols/.gitkeep diff --git a/gns3server/symbols/.gitkeep b/gns3server/symbols/.gitkeep new file mode 100644 index 00000000..e69de29b From f0edf799b78378d66f6cfa6e0a981cbc0da3e5b7 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Wed, 7 Sep 2016 14:24:56 +0200 Subject: [PATCH 3/3] Fix Deleting running telnet docker VM shows error in log Fix #662 --- gns3server/modules/docker/docker_vm.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gns3server/modules/docker/docker_vm.py b/gns3server/modules/docker/docker_vm.py index 680b150b..5af3ce9e 100644 --- a/gns3server/modules/docker/docker_vm.py +++ b/gns3server/modules/docker/docker_vm.py @@ -530,7 +530,11 @@ class DockerVM(BaseVM): if self._ubridge_hypervisor and self._ubridge_hypervisor.is_running(): yield from self._ubridge_hypervisor.stop() - state = yield from self._get_container_state() + try: + state = yield from self._get_container_state() + except DockerHttp404Error: + state = "stopped" + if state == "paused": yield from self.unpause()