summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorankitagrawal <ankit11.agrawal@nttdata.com>2014-10-13 07:56:53 -0700
committerAnkit Agrawal <ankit11.agrawal@nttdata.com>2014-11-06 08:58:15 +0000
commit22b1992dc40b6c3755434b6a7ee5861688674c2f (patch)
tree026911e2a589dfdffae2ad1300482d2f85f1709b
parent41e143b2172a36e4f49bc7e3a1ed97ee8477afb9 (diff)
downloadglance-22b1992dc40b6c3755434b6a7ee5861688674c2f.tar.gz
Fix for adopt glance.store library in Glance
The store module is removed from glance project and new glance_store module is created, but the glance project code was not updated properly for the required changes. _get_from_store and _get_size methods raises store.NotFound exception from glance_store but not caught in the glance api. Updated exception.NotFound to store.NotFound which returns 404 NotFound response to the user. Closes-Bug: #1380552 Change-Id: I068cb90f5db62443115157a027fbdefec9bd4a00 (cherry picked from commit 675a39a74faad5f7fe4eb94e1dcf7f4359ed2285)
-rw-r--r--glance/api/v1/images.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/glance/api/v1/images.py b/glance/api/v1/images.py
index 3b460272f..c85b30131 100644
--- a/glance/api/v1/images.py
+++ b/glance/api/v1/images.py
@@ -459,7 +459,7 @@ class Controller(controller.BaseController):
image_data, image_size = src_store.get(loc, context=context)
- except exception.NotFound as e:
+ except store.NotFound as e:
raise HTTPNotFound(explanation=e.msg)
image_size = int(image_size) if image_size else None
return image_data, image_size
@@ -721,7 +721,7 @@ class Controller(controller.BaseController):
try:
return (image_meta.get('size', 0) or
store.get_size_from_backend(location, context=context))
- except (exception.NotFound, store.BadStoreUri) as e:
+ except (store.NotFound, store.BadStoreUri) as e:
LOG.debug(e)
raise HTTPBadRequest(explanation=e.msg, content_type="text/plain")