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):
if local_image['filename'] not in [i['filename'] for i in images]:
images.append(local_image)
images = sorted(images, key=itemgetter('filename'))
else:
images = sorted(images, key=itemgetter('image'))
except OSError as e:
raise ComputeError("Can't list images: {}".format(str(e)))
images = sorted(images, key=itemgetter('filename'))
return images
@asyncio.coroutine