mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +00:00
Don’t crash on empty AMI name
This commit is contained in:
parent
19e15d15bf
commit
cb886fe3d6
1 changed files with 1 additions and 1 deletions
2
bootstrapvz/providers/ec2/tasks/ami.py
Normal file → Executable file
2
bootstrapvz/providers/ec2/tasks/ami.py
Normal file → Executable file
|
@ -23,7 +23,7 @@ class AMIName(Task):
|
||||||
|
|
||||||
images = info._ec2['connection'].describe_images(Owners=['self'])['Images']
|
images = info._ec2['connection'].describe_images(Owners=['self'])['Images']
|
||||||
for image in 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)
|
msg = 'An image by the name {ami_name} already exists.'.format(ami_name=ami_name)
|
||||||
raise TaskError(msg)
|
raise TaskError(msg)
|
||||||
info._ec2['ami_name'] = ami_name
|
info._ec2['ami_name'] = ami_name
|
||||||
|
|
Loading…
Add table
Reference in a new issue