diff --git a/glance/api/v2/images.py b/glance/api/v2/images.py index ed64f02ab6..84e48fe63a 100644 --- a/glance/api/v2/images.py +++ b/glance/api/v2/images.py @@ -165,7 +165,7 @@ class ImagesController(object): except exception.NotFound as e: msg = ("Failed to find image %(image_id)s to delete" % locals()) LOG.info(msg) - raise webob.exc.HTTPNotFound() + raise webob.exc.HTTPNotFound(explanation=msg) class RequestDeserializer(wsgi.JSONRequestDeserializer): diff --git a/glance/registry/api/v1/members.py b/glance/registry/api/v1/members.py index f2ed5e6552..c76a86351d 100644 --- a/glance/registry/api/v1/members.py +++ b/glance/registry/api/v1/members.py @@ -46,7 +46,7 @@ class Controller(object): except exception.NotFound: msg = _("Image %(id)s not found") LOG.info(msg % {'id': image_id}) - raise webob.exc.HTTPNotFound() + raise webob.exc.HTTPNotFound(msg) except exception.Forbidden: # If it's private and doesn't belong to them, don't let on # that it exists @@ -80,7 +80,7 @@ class Controller(object): except exception.NotFound: msg = _("Image %(id)s not found") LOG.info(msg % {'id': image_id}) - raise webob.exc.HTTPNotFound() + raise webob.exc.HTTPNotFound(msg) except exception.Forbidden: # If it's private and doesn't belong to them, don't let on # that it exists @@ -193,7 +193,7 @@ class Controller(object): except exception.NotFound: msg = _("Image %(id)s not found") LOG.info(msg % {'id': image_id}) - raise webob.exc.HTTPNotFound() + raise webob.exc.HTTPNotFound(msg) except exception.Forbidden: # If it's private and doesn't belong to them, don't let on # that it exists @@ -253,7 +253,7 @@ class Controller(object): except exception.NotFound: msg = _("Image %(id)s not found") LOG.info(msg % {'id': image_id}) - raise webob.exc.HTTPNotFound() + raise webob.exc.HTTPNotFound(msg) except exception.Forbidden: # If it's private and doesn't belong to them, don't let on # that it exists