]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Pass in endpoint url for swift auth_token auth
authorSteve Baker <sbaker@redhat.com>
Tue, 2 Apr 2013 01:13:18 +0000 (14:13 +1300)
committerSteve Baker <sbaker@redhat.com>
Tue, 2 Apr 2013 03:05:44 +0000 (16:05 +1300)
This aligns swift auth_token only authentication with the
way Horizon does it, and avoids python-swiftclient bug #1160172

Tested by launching a stack with and without the --token-only flag

Also tested using Horizon, which is auth_token only

Part of blueprint auth-token-only

Change-Id: I0622f76e93df4f7353fc0cc61dc962b6c8f0be11

heat/engine/clients.py

index 7f51434be1c9121a964aac15a01e5b5da107c3dc..4673f4abac4697670d1a9c62d5f24432c475b042 100644 (file)
@@ -123,20 +123,19 @@ class OpenStackClients(object):
 
         con = self.context
         args = {
-            'auth_version': '2',
+            'auth_version': '2.0',
             'tenant_name': con.tenant,
-            'authurl': con.auth_url,
             'user': con.username
         }
 
         if con.password is not None:
             args['key'] = con.password
+            args['authurl'] = con.auth_url
         elif con.auth_token is not None:
-            args['os_options'] = {
-                'tenant_id': con.tenant_id,
-                'auth_token': con.auth_token,
-                'tenant_name': con.tenant
-            }
+            args['key'] = None
+            args['authurl'] = None
+            args['preauthtoken'] = con.auth_token
+            args['preauthurl'] = self.url_for(service_type='object-store')
         else:
             logger.error("Swift connection failed, no password or " +
                          "auth_token!")