diff options
author | Zuul <zuul@review.opendev.org> | 2022-09-16 19:21:38 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2022-09-16 19:21:38 +0000 |
commit | 7f5fb70904088b7227db3e427011127e6d7fc77d (patch) | |
tree | 1a1985bd796bd94bd75a790d1ed132e5285ce9a7 | |
parent | a4ea5ab3a2b18edd96526eb8b37a03d47ff9b736 (diff) | |
parent | aa50b963cce20a76db0c4834b3716d3658c784af (diff) | |
download | keystone-7f5fb70904088b7227db3e427011127e6d7fc77d.tar.gz |
Merge "Fix host:port handling" into stable/wallaby
-rw-r--r-- | keystone/api/ec2tokens.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/keystone/api/ec2tokens.py b/keystone/api/ec2tokens.py index 12096db9e..d21673a03 100644 --- a/keystone/api/ec2tokens.py +++ b/keystone/api/ec2tokens.py @@ -12,6 +12,8 @@ # This file handles all flask-restful resources for /v3/ec2tokens +import urllib.parse + import flask import http.client from keystoneclient.contrib.ec2 import utils as ec2_utils @@ -42,8 +44,8 @@ class EC2TokensResource(EC2_S3_Resource.ResourceBase): # NOTE(vish): Some client libraries don't use the port when # signing requests, so try again without the port. elif ':' in credentials['host']: - hostname, _port = credentials.split(':') - credentials['host'] = hostname + parsed = urllib.parse.urlsplit('//' + credentials['host']) + credentials['host'] = parsed.hostname # NOTE(davechen): we need to reinitialize 'signer' to avoid # contaminated status of signature, this is similar with # other programming language libraries, JAVA for example. |