diff --git a/glance/api/v2/images.py b/glance/api/v2/images.py index d7e5d09833..d23cadb7d7 100644 --- a/glance/api/v2/images.py +++ b/glance/api/v2/images.py @@ -178,7 +178,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) def _get_locations_op_pos(self, path_pos, max_pos, allow_max): if path_pos is None or max_pos is None: 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