From: Andrew Plunk Date: Tue, 11 Jun 2013 15:18:10 +0000 (-0500) Subject: Key error when auth in standalone mode X-Git-Tag: 2014.1~500^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=70990d3106808cf9f73a35815687b073500e21e8;p=openstack-build%2Fheat-build.git 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 --- diff --git a/heat/common/auth_password.py b/heat/common/auth_password.py index bcc97993..0d354ca1 100644 --- a/heat/common/auth_password.py +++ b/heat/common/auth_password.py @@ -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'] diff --git a/heat/tests/test_auth_password.py b/heat/tests/test_auth_password.py index cd94d713..9974fcea 100644 --- a/heat/tests/test_auth_password.py +++ b/heat/tests/test_auth_password.py @@ -45,7 +45,7 @@ TOKEN_RESPONSE = { }, 'user': { 'id': 'user_id1', - 'username': 'user_name1', + 'name': 'user_name1', 'roles': [ {'name': 'role1'}, {'name': 'role2'},