← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1068030] Re: revoke token fails beacuse of unscoped tokens

 

** Changed in: keystone
       Status: Triaged => Invalid

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Keystone.
https://bugs.launchpad.net/bugs/1068030

Title:
  revoke token fails beacuse of unscoped tokens

Status in OpenStack Identity (Keystone):
  Invalid

Bug description:
  Hello!

  Versions:
  keystone -2012.2-0ubuntu1~cloud0 
  python-keystone-2012.2-0ubuntu1~cloud0

  Here the error mesage from the keystone.log:

  : 2012-10-17 10:31:09,508 ERROR 'NoneType' object has no attribute 'get'
  Traceback (most recent call last):
    File "/usr/lib/python2.7/dist-packages/keystone/common/wsgi.py", line 204, in __call__
      result = method(context, **params)
    File "/usr/lib/python2.7/dist-packages/keystone/identity/core.py", line 595, in add_role_to_user
      self.token_api.revoke_tokens(context, user_id, tenant_id)
    File "/usr/lib/python2.7/dist-packages/keystone/token/core.py", line 48, in revoke_tokens
      for token_id in self.list_tokens(context, user_id, tenant_id):
    File "/usr/lib/python2.7/dist-packages/keystone/common/manager.py", line 47, in _wrapper
      return f(*args, **kw)
    File "/usr/lib/python2.7/dist-packages/keystone/token/backends/sql.py", line 113, in list_tokens
      if token_ref_dict['tenant'].get('id') != tenant_id:

  How to reproduce:

  try to login:
  # curl -k -X 'POST' -v https://cc:35357/v2.0/tokens -d '{"auth":{"passwordCredentials":{"username": "clouduser", "password":"clouduser"}}}' -H 'Content-type: application/json'

  now create a role:
  # keystone role-create --name NAME
  # keystone user-role-add --user-id ID --role-id ID --tenant-id ID
  ERROR 'NoneType' object has no attribute 'get'

  The unscoped token has no tenant information in the db however the
  list_tokens function asumes that there is one.

  I have a small patch which ignores these tokens, but i don't really
  know if this brings some negatives sideeffects.

  Alex

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1068030/+subscriptions