Merge pull request #392 from gplessis/empty-ami-names

Don’t crash on empty AMI name
This commit is contained in:
Anders Ingemann 2017-08-24 13:47:42 +02:00 committed by GitHub
commit 4e06eb1f88

2
bootstrapvz/providers/ec2/tasks/ami.py Normal file → Executable file
View file

@ -23,7 +23,7 @@ class AMIName(Task):
images = info._ec2['connection'].describe_images(Owners=['self'])['Images']
for image in images:
if ami_name == image['Name']:
if 'Name' in image and ami_name == image['Name']:
msg = 'An image by the name {ami_name} already exists.'.format(ami_name=ami_name)
raise TaskError(msg)
info._ec2['ami_name'] = ami_name