auth_token middleware: global name 'self' is not defined

Bug #901049 reported by Dan Prince
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Undecided
Dan Prince

Bug Description

Using the latest version of keystone Essex: 3e3f239538bcafc6189e3cb44f9ab0c9366fa0cc

I'm seeing the following exceptions when using the auth token middleware:

2011-12-07 02:51:12 DEBUG [eventlet.wsgi.server] Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/eventlet/wsgi.py", line 336, in handle_one_response
    result = self.application(self.environ, start_response)
  File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/glance/common/wsgi.py", line 174, in __call__
    response = req.get_response(self.application)
  File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1053, in get_response
    application, catch_exc_info=False)
  File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1022, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/lib/python2.7/dist-packages/keystone/middleware/auth_token.py", line 270, in __call__
    claims = self._verify_claims(env, token)
  File "/usr/lib/python2.7/dist-packages/keystone/middleware/auth_token.py", line 400, in _verify_claims
    cached_claims = self._cache_get(env, claims)
NameError: global name 'self' is not defined

Full stack trace here:

http://paste.openstack.org/show/3670/

Dan Prince (dan-prince)
Changed in keystone:
status: New → In Progress
assignee: nobody → Dan Prince (dan-prince)
Revision history for this message
Dan Prince (dan-prince) wrote :

I think this should fix it:

--- a/keystone/middleware/auth_token.py
+++ b/keystone/middleware/auth_token.py
@@ -393,8 +393,7 @@ class AuthProtocol(object):
         return HTTPUnauthorized()(env,
             start_response)

- @staticmethod
- def _verify_claims(env, claims):
+ def _verify_claims(self, env, claims):

Testing now...

Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/2130
Committed: http://github.com/openstack/keystone/commit/38dd9c70f2addb75704b0f1f230b41475d4d9adf
Submitter: Jenkins
Branch: master

 status fixcommitted
 done

commit 38dd9c70f2addb75704b0f1f230b41475d4d9adf
Author: Dan Prince <email address hidden>
Date: Tue Dec 6 22:48:32 2011 -0500

    Fix auth_token middleware: make _verify_claims not static. Fixes bug #901049.

    Change-Id: I8498b8c89a5818a7dcca3f74aa98289d957eac74

Changed in keystone:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in keystone:
milestone: none → essex-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: essex-2 → 2012.1
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.