Key error when auth in standalone mode

Fix a key error caused from the response of authing
in stand alone mode. The keystone docs indicate that
the schema for a response user name is ['user']['name']
rather than ['user']['username'].

Change-Id: I9ac94feeef8f9f2dedaa3842f64a3491e701e199
This commit is contained in:
Andrew Plunk 2013-06-11 10:18:10 -05:00
parent 56d5fb9f83
commit 70990d3106
2 changed files with 2 additions and 2 deletions

View File

@ -74,7 +74,7 @@ class KeystonePasswordAuthProtocol(object):
tenant_id = token_info['token']['tenant']['id']
tenant_name = token_info['token']['tenant']['name']
user_id = token_info['user']['id']
user_name = token_info['user']['username']
user_name = token_info['user']['name']
roles = ','.join(
[role['name'] for role in token_info['user']['roles']])
service_catalog = token_info['serviceCatalog']

View File

@ -45,7 +45,7 @@ TOKEN_RESPONSE = {
},
'user': {
'id': 'user_id1',
'username': 'user_name1',
'name': 'user_name1',
'roles': [
{'name': 'role1'},
{'name': 'role2'},