From 08bafc2dcc33b63d09f1e8aece4d27d5742454a6 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Thu, 16 Mar 2017 10:39:08 +0100 Subject: [PATCH] Catch a timeout error in docker Fix #936 --- gns3server/compute/docker/docker_vm.py | 2 +- tests/compute/docker/test_docker_vm.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gns3server/compute/docker/docker_vm.py b/gns3server/compute/docker/docker_vm.py index ccfbbaf8..1a995e9a 100644 --- a/gns3server/compute/docker/docker_vm.py +++ b/gns3server/compute/docker/docker_vm.py @@ -768,7 +768,7 @@ class DockerVM(BaseNode): Pull image from docker repository """ log.info("Pull %s from docker hub", image) - response = yield from self.manager.http_query("POST", "images/create", params={"fromImage": image}) + response = yield from self.manager.http_query("POST", "images/create", params={"fromImage": image}, timeout=None) # The pull api will stream status via an HTTP JSON stream content = "" while True: diff --git a/tests/compute/docker/test_docker_vm.py b/tests/compute/docker/test_docker_vm.py index d55b411e..41db546b 100644 --- a/tests/compute/docker/test_docker_vm.py +++ b/tests/compute/docker/test_docker_vm.py @@ -819,7 +819,7 @@ def test_pull_image(loop, vm): with asyncio_patch("gns3server.compute.docker.Docker.http_query", return_value=mock_query) as mock: images = loop.run_until_complete(asyncio.async(vm.pull_image("ubuntu"))) - mock.assert_called_with("POST", "images/create", params={"fromImage": "ubuntu"}) + mock.assert_called_with("POST", "images/create", params={"fromImage": "ubuntu"}, timeout=None) def test_start_capture(vm, tmpdir, manager, free_console_port, loop):