From: Steven Hardy Date: Fri, 19 Oct 2012 15:12:15 +0000 (+0100) Subject: heat engine : remove unused EC2 style auth from engine X-Git-Tag: 2014.1~1290 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=52968f4a16b1af85770f532f734143add807c53b;p=openstack-build%2Fheat-build.git heat engine : remove unused EC2 style auth from engine We handle EC2 style auth at the heat-api-cfn level, so EC2 style authenticated requests simply pass us an auth_token in the context, so remove this duplicate/dead code. Ref #268 Change-Id: I17708cb6ef4b0eb4989d47c116b6211f0d419dcb Signed-off-by: Steven Hardy --- diff --git a/heat/engine/auth.py b/heat/engine/auth.py index b422dbe1..cffc566c 100644 --- a/heat/engine/auth.py +++ b/heat/engine/auth.py @@ -89,41 +89,8 @@ def authenticate(con, service_type='cloudformation', service_name='heat-cfn'): 'proxy_tenant_id': con.tenant_id, } else: - # We'll have to do AWS style auth which is more complex. - # First step is to get a token from the AWS creds. - headers = {'Content-Type': 'application/json'} - - o = urlparse.urlparse(con.aws_auth_uri) - if o.scheme == 'http': - conn = httplib.HTTPConnection(o.netloc) - else: - conn = httplib.HTTPSConnection(o.netloc) - conn.request('POST', o.path, body=con.aws_creds, headers=headers) - response = conn.getresponse().read() - conn.close() - - result = json.loads(response) - try: - token_id = result['access']['token']['id'] - # We grab the username here because with token auth and EC2 - # we never get it normally. We could pass it in but then We - # are relying on user input to give us the correct username. - # This one is the result of the authentication and is verified. - username = result['access']['user']['username'] - con.username = username - - logger.info("AWS authentication successful.") - except (AttributeError, KeyError): - # FIXME: Should be 404 I think. - logger.info("AWS authentication failure.") - raise exception.AuthorizationFailure() - - credentials = { - 'username': con.service_user, - 'api_key': con.service_password, - 'proxy_token': token_id, - 'proxy_tenant_id': con.tenant_id, - } + logger.error("Authentication failed, no password or auth_token!") + return None args.update(credentials) try: