summaryrefslogtreecommitdiffstats
path: root/nova/image
diff options
context:
space:
mode:
authorChuck Short <chuck.short@canonical.com>2012-12-07 09:17:09 -0600
committerChuck Short <chuck.short@canonical.com>2012-12-18 14:03:19 -0600
commitd774b3a2fb80f73cb2508a5273645589950c4975 (patch)
tree7c0c15c6ffca74dc5ca2a504fd770826056981a4 /nova/image
parent5fa80467c2d03e514f5d2cd574406d8895fcecc4 (diff)
downloadnova-d774b3a2fb80f73cb2508a5273645589950c4975.tar.gz
nova-d774b3a2fb80f73cb2508a5273645589950c4975.tar.xz
nova-d774b3a2fb80f73cb2508a5273645589950c4975.zip
Traceback when user doesn't have permission.
When a user tries to access an image that is forbidden it sends an HTTPForbidden. Inform the user with a help message that the permission is not available to them. Change-Id: I3082c789876440226b5f177216ec628436c7b3ce Signed-off-by: Chuck Short <chuck.short@canonical.com>
Diffstat (limited to 'nova/image')
-rw-r--r--nova/image/glance.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/nova/image/glance.py b/nova/image/glance.py
index ce6fd530f..9a93df2ab 100644
--- a/nova/image/glance.py
+++ b/nova/image/glance.py
@@ -275,12 +275,15 @@ class GlanceImageService(object):
:raises: ImageNotFound if the image does not exist.
:raises: NotAuthorized if the user is not an owner.
+ :raises: ImageNotAuthorized if the user is not authorized.
"""
try:
self._client.call(context, 1, 'delete', image_id)
except glanceclient.exc.NotFound:
raise exception.ImageNotFound(image_id=image_id)
+ except glanceclient.exc.HTTPForbidden:
+ raise exception.ImageNotAuthorized(image_id=image_id)
return True
@staticmethod