make sure proper exceptions are raised for ec2 id conversion and add tests

This commit is contained in:
Vishvananda Ishaya
2011-05-11 11:02:01 -07:00
parent eebd99a695
commit 672af33630
2 changed files with 19 additions and 2 deletions

View File

@@ -972,7 +972,7 @@ class ImageCommands(object):
try:
internal_id = ec2utils.ec2_id_to_id(old_image_id)
image = self.image_service.show(context, internal_id)
except exception.NotFound:
except (exception.InvalidEc2Id, exception.ImageNotFound):
image = self.image_service.show_by_name(context, old_image_id)
return image['id']