summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@gmail.com>2011-04-12 21:51:59 +0000
committerTarmac <>2011-04-12 21:51:59 +0000
commit4a8c3023f752327b475ada39d7bbcae6bc69890e (patch)
treee1457bee017e562cd126a30169ce3fa33a97a3af /nova/api
parentb33c81f05ddd5d3ac4e83b796b9675d4f6e56e7d (diff)
parent76bb9f42c6cc39218824332e396dca4a5e6ec351 (diff)
Fixes s3.py to allow looking up images by name. Smoketests run unmodified again with this change!
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/ec2/cloud.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py
index 5e81878c4..10b1d0ac5 100644
--- a/nova/api/ec2/cloud.py
+++ b/nova/api/ec2/cloud.py
@@ -908,7 +908,10 @@ class CloudController(object):
internal_id = ec2utils.ec2_id_to_id(ec2_id)
return self.image_service.show(context, internal_id)
except exception.NotFound:
- return self.image_service.show_by_name(context, ec2_id)
+ try:
+ return self.image_service.show_by_name(context, ec2_id)
+ except exception.NotFound:
+ raise exception.NotFound(_('Image %s not found') % ec2_id)
def _format_image(self, image):
"""Convert from format defined by BaseImageService to S3 format."""