summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorWilliam Wolf <throughnothing@gmail.com>2011-05-20 14:22:58 -0400
committerWilliam Wolf <throughnothing@gmail.com>2011-05-20 14:22:58 -0400
commit7ed71092d513bc621be539e612e6b4e66849b888 (patch)
tree76e488453deca7d7fa09c3d90767ad42d4308570 /nova/api
parent355ef9c0a65cfb4bac1f21f39e149d77a27bd6a4 (diff)
combined the exception catching to eliminate duplication
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/images.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/nova/api/openstack/images.py b/nova/api/openstack/images.py
index 5508e7d50..523b3f431 100644
--- a/nova/api/openstack/images.py
+++ b/nova/api/openstack/images.py
@@ -87,10 +87,7 @@ class Controller(common.OpenstackController):
(image_service, service_image_id) = utils.get_image_service(
id)
image = image_service.show(context, service_image_id)
- except exception.NotFound:
- explanation = _("Image not found.")
- raise faults.Fault(webob.exc.HTTPNotFound(explanation=explanation))
- except exception.InvalidImageRef:
+ except (exception.NotFound, exception.InvalidImageRef):
explanation = _("Image not found.")
raise faults.Fault(webob.exc.HTTPNotFound(explanation=explanation))