From 70990d3106808cf9f73a35815687b073500e21e8 Mon Sep 17 00:00:00 2001 From: Andrew Plunk Date: Tue, 11 Jun 2013 10:18:10 -0500 Subject: [PATCH] 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 --- heat/common/auth_password.py | 2 +- heat/tests/test_auth_password.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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'}, -- 2.45.2