Forbidden exception being incorrectly instantiated by filesystem driver
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
glance_store |
Fix Released
|
High
|
Taylor Peoples | ||
Kilo |
Fix Released
|
Undecided
|
Unassigned | ||
Liberty |
Fix Released
|
High
|
Taylor Peoples |
Bug Description
Stack trace:
File "/usr/lib/
result = self.applicatio
File "/usr/lib/
resp = self.call_func(req, *args, **self.kwargs)
File "/usr/lib/
return self.func(req, *args, **kwargs)
File "/usr/lib/
response = req.get_
File "/usr/lib/
application, catch_exc_
File "/usr/lib/
app_iter = application(
File "/usr/lib/
resp = self.call_func(req, *args, **self.kwargs)
File "/usr/lib/
return self.func(req, *args, **kwargs)
File "/usr/lib/
return request.
File "/usr/lib/
application, catch_exc_
File "/usr/lib/
app_iter = application(
File "/usr/lib/
return self._call_app(env, start_response)
File "/usr/lib/
return self._app(env, _fake_start_
File "/usr/lib/
resp = self.call_func(req, *args, **self.kwargs)
File "/usr/lib/
return self.func(req, *args, **kwargs)
File "/usr/lib/
response = req.get_
File "/usr/lib/
application, catch_exc_
File "/usr/lib/
app_iter = application(
File "/usr/lib/
return app(environ, start_response)
File "/usr/lib/
return resp(environ, start_response)
File "/usr/lib/
response = self.app(environ, start_response)
File "/usr/lib/
return resp(environ, start_response)
File "/usr/lib/
resp = self.call_func(req, *args, **self.kwargs)
File "/usr/lib/
return self.func(req, *args, **kwargs)
File "/usr/lib/
request, **action_args)
File "/usr/lib/
return method(*args, **kwargs)
File "/usr/lib/
return func(self, req, *args, **kwargs)
File "/usr/lib/
{'status': ori_status})
File "/usr/lib/
six.
File "/usr/lib/
upload_
File "/usr/lib/
id, location_data)
File "/usr/lib/
safe_
File "/usr/lib/
ret = store_api.
File "/usr/lib/
return store.delete(loc, context=context)
File "/usr/lib/
return store_op_fun(store, *args, **kwargs)
File "/usr/lib/
raise exceptions.
TypeError: __init__() takes exactly 1 argument (2 given)
glance_
def delete(self, location, context=None):
"""
Takes a `glance_
where to find the image file to delete
:location `glance_
:raises NotFound if image does not exist
:raises Forbidden if cannot delete because of permissions
"""
loc = location.
fn = loc.path
if os.path.exists(fn):
try:
except OSError:
else:
raise exceptions.
The problem is that the instantiation of exceptions.
class Forbidden(
message = _("You are not authorized to complete this action.")
class GlanceStoreExce
"""
Base Glance Store Exception
To correctly use this class, inherit from it and define
a 'message' property. That message will get printf'd
with the keyword arguments provided to the constructor.
"""
message = ''
def __init__(self, **kwargs):
self.msg = kwargs.
If the instantiation within filesystem.py is changed to:
raise exceptions.
then the exception is thrown as expected:
...
File "/usr/lib/
raise exceptions.
Forbidden: You cannot delete file /var/lib/
Changed in glance-store: | |
assignee: | nobody → Taylor Peoples (tpeoples) |
status: | New → In Progress |
https:/ /review. openstack. org/#/c/ 176819/