1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-28 11:18:11 +00:00

Add explicit error when trying to pull a Docker image from Docker Hub without Internet access. Fixes #1506.

This commit is contained in:
grossmj 2019-02-17 19:21:21 +08:00
parent 0b07299472
commit d9a9abf845

View File

@ -200,7 +200,10 @@ class Docker(BaseManager):
if progress_callback: if progress_callback:
progress_callback("Pulling '{}' from docker hub".format(image)) progress_callback("Pulling '{}' from docker hub".format(image))
try:
response = yield from self.http_query("POST", "images/create", params={"fromImage": image}, timeout=None) 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 # The pull api will stream status via an HTTP JSON stream
content = "" content = ""
while True: while True: