Saw this when creating client support:
$ openstack consumer delete 8b0899403f93496384cddc0755953ba8
ERROR: cliff.app An unexpected error prevented the server from fulfilling your request. 'token' (HTTP 500)
Keystone error:
(keystone.common.wsgi): 2013-08-22 10:16:41,241 ERROR wsgi __call__ 'token'
Traceback (most recent call last):
File "/opt/stack/keystone/keystone/common/wsgi.py", line 237, in __call__
result = method(context, **params)
File "/opt/stack/keystone/keystone/contrib/oauth1/controllers.py", line 60, in delete_consumer
self.token_api.delete_tokens(user_id, consumer_id=consumer_id)
File "/opt/stack/keystone/keystone/common/manager.py", line 44, in _wrapper
return f(*args, **kw)
File "/opt/stack/keystone/keystone/token/backends/sql.py", line 109, in delete_tokens
if not self._consumer_matches(consumer_id, token_ref_dict):
File "/opt/stack/keystone/keystone/token/backends/sql.py", line 125, in _consumer_matches
oauth = token_ref_dict['token_data']['token'].get('OS-OAUTH1', {})
KeyError: 'token'
Suggested fix is to wrap the else block of _consumer_matches in a try, and catch any KeyErrors.
Reviewed: https:/ /review. openstack. org/43182 github. com/openstack/ keystone/ commit/ f28d9f4f7b22211 9b5c5481eb7d318 695ce43c95
Committed: http://
Submitter: Jenkins
Branch: master
commit f28d9f4f7b22211 9b5c5481eb7d318 695ce43c95
Author: Steve Martinelli <email address hidden>
Date: Wed Aug 21 14:23:04 2013 -0500
Fix error where consumer is not deleted from sql
Looks like when the token sql backend was going through tokens
to delete, it didn't like if the token ref didn't have a token
field. I placed a guard in there now.
fixes bug: #1215493
Change-Id: Ia12f5e4d9af71c 322c9230464ae39 ec88303b600