Context is not passed when creating a new server via OpenStack API

Bug #686621 reported by Chmouel Boudjnah
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Chmouel Boudjnah

Bug Description

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

Related branches

Changed in nova:
assignee: nobody → Chmouel Boudjnah (chmouel)
Thierry Carrez (ttx)
Changed in nova:
importance: Undecided → High
status: New → In Progress
Thierry Carrez (ttx)
Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → 2011.1
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.