Open maitreya1975 opened 10 years ago
I'm facing the same issue and it happens sporadically.
img = ec2.get_image(image_id)
File "/usr/lib/python2.7/site-packages/boto/ec2/connection.py", line 263, in get_image
return self.get_all_images(image_ids=[image_id], dry_run=dry_run)[0]
File "/usr/lib/python2.7/site-packages/boto/ec2/connection.py", line 189, in get_all_images
[('item', Image)], verb='POST')
File "/usr/lib/python2.7/site-packages/boto/connection.py", line 1186, in get_list
raise self.ResponseError(response.status, response.reason, body)
boto.exception.EC2ResponseError: EC2ResponseError: 400 Bad Request
<?xml version="1.0" encoding="UTF-8"?>
<Response><Errors><Error><Code>InvalidAMIID.NotFound</Code><Message>The image id '[ami-9fec6bec]' does not exist</Message></Error></Errors><RequestID>f62acd0a-31f1-46ff-8f81-c3bce3287e61</RequestID></Response>
Is there any PR to merge the fix?
The documentation (http://docs.pythonboto.org/en/latest/ref/ec2.html#boto.ec2.connection.EC2Connection.get_image) states that the method get_image Returns:
The EC2 Image specified or None if the image is not found.
However, if the AMI ID is not found, it throws an exception instead of returning None.
Sample Verbose output when invoking get_image with an invalid AMI ID: