registry team mailing list archive
-
registry team
-
Mailing list archive
-
Message #30330
[Bug 686621] [NEW] Context is not passed when creating a new server via OpenStack API
Public bug reported:
when creating a server via the OpenStack API I am getting :
WARNING:root:Caught error: die
DEBUG:root:Traceback (most recent call last):
File "/home/chmouel/nova/code/trunk/nova/api/openstack/__init__.py", line 62, in __call__
return req.get_response(self.application)
File "/usr/local/lib/python2.6/dist-packages/webob/request.py", line 937, in get_response
application, catch_exc_info=False)
File "/usr/local/lib/python2.6/dist-packages/webob/request.py", line 906, in call_application
app_iter = application(self.environ, start_response)
File "/usr/local/lib/python2.6/dist-packages/webob/dec.py", line 159, in __call__
return resp(environ, start_response)
File "/usr/local/lib/python2.6/dist-packages/webob/dec.py", line 159, in __call__
return resp(environ, start_response)
File "/usr/local/lib/python2.6/dist-packages/webob/dec.py", line 159, in __call__
return resp(environ, start_response)
File "/usr/lib/pymodules/python2.6/routes/middleware.py", line 131, in __call__
response = self.app(environ, start_response)
File "/usr/local/lib/python2.6/dist-packages/webob/dec.py", line 159, in __call__
return resp(environ, start_response)
File "/usr/local/lib/python2.6/dist-packages/webob/dec.py", line 147, in __call__
resp = self.call_func(req, *args, **self.kwargs)
File "/usr/local/lib/python2.6/dist-packages/webob/dec.py", line 208, in call_func
return self.func(req, *args, **kwargs)
File "/home/chmouel/nova/code/trunk/nova/wsgi.py", line 234, in __call__
result = method(**arg_dict)
File "/home/chmouel/nova/code/trunk/nova/api/openstack/servers.py", line 138, in create
key_pair = self.db_driver.key_pair_get_all_by_user(None, user_id)[0]
File "/home/chmouel/nova/code/trunk/nova/db/api.py", line 362, in key_pair_get_all_by_user
return IMPL.key_pair_get_all_by_user(context, user_id)
File "/home/chmouel/nova/code/trunk/nova/db/sqlalchemy/api.py", line 106, in wrapper
if not is_admin_context(args[0]) and not is_user_context(args[0]):
File "/home/chmouel/nova/code/trunk/nova/db/sqlalchemy/api.py", line 46, in is_admin_context
raise Exception('die')
Exception: die
is_admin_context code :
def is_admin_context(context):
"""Indicates if the request context is an administrator."""
if not context:
warnings.warn('Use of empty request context is deprecated',
DeprecationWarning)
raise Exception('die')
return context.is_admin
** Affects: nova
Importance: Undecided
Assignee: Chmouel Boudjnah (chmouel)
Status: New
** Changed in: nova
Assignee: (unassigned) => Chmouel Boudjnah (chmouel)
--
You received this bug notification because you are a member of Registry
Administrators, which is subscribed to OpenStack.
https://bugs.launchpad.net/bugs/686621
Title:
Context is not passed when creating a new server via OpenStack API
Follow ups
References