summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Tran <jtran@attinteractive.com>2011-05-12 12:04:39 -0700
committerJohn Tran <jtran@attinteractive.com>2011-05-12 12:04:39 -0700
commit0a3da155228228d3f0eeac1efdea1e29eef2f3a0 (patch)
treea9a3c2a18a01b82505c0a469148f6a97c9d9cfe8
parent86952493efb67b64b23766af094aa22deb21307f (diff)
changed NotFound exception to ImageNotFound
-rw-r--r--nova/api/ec2/cloud.py3
-rw-r--r--nova/tests/test_cloud.py4
2 files changed, 3 insertions, 4 deletions
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py
index 8a54d23f2..ad8c3fe90 100644
--- a/nova/api/ec2/cloud.py
+++ b/nova/api/ec2/cloud.py
@@ -823,8 +823,7 @@ class CloudController(object):
kwargs['ramdisk_id'] = ramdisk['id']
image = self._get_image(context, kwargs['image_id'])
if not image:
- raise exception.NotFound(_('Image %s not found') %
- kwargs['image_id'])
+ raise exception.ImageNotFound(kwargs['image_id'])
try:
available = (image['properties']['image_state'] == 'available')
except KeyError:
diff --git a/nova/tests/test_cloud.py b/nova/tests/test_cloud.py
index 202dc36bc..ebfb5ee44 100644
--- a/nova/tests/test_cloud.py
+++ b/nova/tests/test_cloud.py
@@ -227,7 +227,7 @@ class CloudTestCase(test.TestCase):
'type': 'machine'}}]
def fake_show_none(meh, context, id):
- raise exception.NotFound
+ raise exception.ImageNotFound
self.stubs.Set(local.LocalImageService, 'detail', fake_detail)
# list all
@@ -245,7 +245,7 @@ class CloudTestCase(test.TestCase):
self.stubs.UnsetAll()
self.stubs.Set(local.LocalImageService, 'show', fake_show_none)
self.stubs.Set(local.LocalImageService, 'show_by_name', fake_show_none)
- self.assertRaises(exception.NotFound, describe_images,
+ self.assertRaises(exception.ImageNotFound, describe_images,
self.context, ['ami-fake'])
def test_describe_image_attribute(self):