From: Zane Bitter Date: Tue, 16 Oct 2012 14:33:55 +0000 (+0200) Subject: Use password in preference to token if both supplied X-Git-Tag: 2014.1~1298 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=a97c6d3181a3d09751c3f88eee5a43e9eed0ad37;p=openstack-build%2Fheat-build.git Use password in preference to token if both supplied Fixes #263 - devstack is providing a token in the environment, which was causing the wrong path to get hit. Change-Id: I9aae346e57fdfe156e52d4696e8f2f859884ff2f Signed-off-by: Zane Bitter --- diff --git a/heat/engine/auth.py b/heat/engine/auth.py index 067e323b..616ed18f 100644 --- a/heat/engine/auth.py +++ b/heat/engine/auth.py @@ -76,18 +76,18 @@ def authenticate(con, service_type='cloudformation', service_name='heat'): 'service_name': service_name, } - if con.auth_token is not None: + if con.password is not None: + credentials = { + 'username': con.username, + 'api_key': con.password, + } + elif con.auth_token is not None: credentials = { 'username': con.service_user, 'api_key': con.service_password, 'proxy_token': con.auth_token, 'proxy_tenant_id': con.tenant_id, } - elif con.password is not None: - credentials = { - 'username': con.username, - 'api_key': con.password, - } else: # We'll have to do AWS style auth which is more complex. # First step is to get a token from the AWS creds.