From d9a9abf84505b269c93e55e8ff50aae527623e62 Mon Sep 17 00:00:00 2001 From: grossmj Date: Sun, 17 Feb 2019 19:21:21 +0800 Subject: [PATCH] Add explicit error when trying to pull a Docker image from Docker Hub without Internet access. Fixes #1506. --- gns3server/compute/docker/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gns3server/compute/docker/__init__.py b/gns3server/compute/docker/__init__.py index f7ee075e..87152338 100644 --- a/gns3server/compute/docker/__init__.py +++ b/gns3server/compute/docker/__init__.py @@ -200,7 +200,10 @@ class Docker(BaseManager): if progress_callback: progress_callback("Pulling '{}' from docker hub".format(image)) - response = yield from self.http_query("POST", "images/create", params={"fromImage": image}, timeout=None) + try: + response = yield from self.http_query("POST", "images/create", params={"fromImage": image}, timeout=None) + except DockerError as e: + raise DockerError("Could not pull the '{}' image from Docker Hub, please check your Internet connection (original error: {})".format(image, e)) # The pull api will stream status via an HTTP JSON stream content = "" while True: