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

Fix KeyError: 'filename'

Fix #1018
This commit is contained in:
Julien Duponchelle 2017-05-09 12:25:15 +02:00
parent 2172c25df6
commit 050f6876ce
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8

View File

@ -601,9 +601,11 @@ class Compute:
for local_image in list_images(type): for local_image in list_images(type):
if local_image['filename'] not in [i['filename'] for i in images]: if local_image['filename'] not in [i['filename'] for i in images]:
images.append(local_image) images.append(local_image)
images = sorted(images, key=itemgetter('filename'))
else:
images = sorted(images, key=itemgetter('image'))
except OSError as e: except OSError as e:
raise ComputeError("Can't list images: {}".format(str(e))) raise ComputeError("Can't list images: {}".format(str(e)))
images = sorted(images, key=itemgetter('filename'))
return images return images
@asyncio.coroutine @asyncio.coroutine