1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-12 19:38:57 +00:00

Handle OSerror when listing images

Fix #823
This commit is contained in:
Julien Duponchelle 2016-12-12 10:13:29 +01:00
parent 4bb990bf0c
commit 4cd08c8955
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8

View File

@ -563,10 +563,13 @@ class Compute:
res = yield from self.http_query("GET", "/{}/images".format(type), timeout=None)
images = res.json
if type in ["qemu", "dynamips", "iou"]:
for local_image in list_images(type):
if local_image['filename'] not in [i['filename'] for i in images]:
images.append(local_image)
try:
if type in ["qemu", "dynamips", "iou"]:
for local_image in list_images(type):
if local_image['filename'] not in [i['filename'] for i in images]:
images.append(local_image)
except OSError as e:
raise ComputeError("Can't list images: {}".format(str(e)))
return images
@asyncio.coroutine