Correct GlanceStoreException to provide valid message - Glance

This is the relevant change on glance side. The main change on
glance_store side is Ic4423405f831088fb51de7cfdf1243e9a0ff32ea ,
which be used to allow glance_store exception provide a proper error
message instead of None message all the time.

Note, once the change on glance_store side get merged, we need to land
this for glance before release new glance_store.

Change-Id: I0d6aa29bca3809da4c71d278ef17897eae15ee6c
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
This commit is contained in:
Zhi Yan Liu 2014-11-26 21:05:09 +08:00
parent 067b0db570
commit 348a5c31e5
2 changed files with 2 additions and 2 deletions

View File

@ -172,7 +172,7 @@ class FakeStoreAPI(object):
raise store.UnknownScheme(scheme=scheme)
return self.data[location]
except KeyError:
raise store.NotFound()
raise store.NotFound(image=location)
def get_size_from_backend(self, location, context=None):
return self.get_from_backend(location, context=context)[1]

View File

@ -477,7 +477,7 @@ class TestImageDataSerializer(test_utils.BaseTestCase):
"""
with mock.patch.object(glance.api.policy.ImageProxy,
'get_data') as mock_get_data:
mock_get_data.side_effect = glance_store.NotFound()
mock_get_data.side_effect = glance_store.NotFound(image="image")
request = wsgi.Request.blank('/')
response = webob.Response()