]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Key error when auth in standalone mode
authorAndrew Plunk <andrew.plunk@rackspace.com>
Tue, 11 Jun 2013 15:18:10 +0000 (10:18 -0500)
committerAndrew Plunk <andrew.plunk@rackspace.com>
Tue, 11 Jun 2013 15:20:53 +0000 (10:20 -0500)
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
heat/tests/test_auth_password.py

index bcc97993eff9caf2e1be6b19131637bcaa967ea5..0d354ca1476b8bfe2b2f0c7d1b5e496e2e50134e 100644 (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']
index cd94d71317c7cea9bef65ed245bba14869b22be4..9974fceadf07e255a2bb640081a73e198c0a711e 100644 (file)
@@ -45,7 +45,7 @@ TOKEN_RESPONSE = {
     },
     'user': {
         'id': 'user_id1',
-        'username': 'user_name1',
+        'name': 'user_name1',
         'roles': [
             {'name': 'role1'},
             {'name': 'role2'},