diff --git a/glanceclient/common/http.py b/glanceclient/common/http.py index 2dc28408..d1dc61de 100644 --- a/glanceclient/common/http.py +++ b/glanceclient/common/http.py @@ -39,6 +39,7 @@ import OpenSSL from glanceclient.common import utils from glanceclient import exc +from glanceclient.openstack.common import network_utils from glanceclient.openstack.common import strutils try: @@ -85,7 +86,7 @@ class HTTPClient(object): @staticmethod def parse_endpoint(endpoint): - return parse.urlparse(endpoint) + return network_utils.urlsplit(endpoint) @staticmethod def get_connection_class(scheme): diff --git a/tests/test_http.py b/tests/test_http.py index e439ede0..e68dc093 100644 --- a/tests/test_http.py +++ b/tests/test_http.py @@ -304,9 +304,9 @@ class TestClient(testtools.TestCase): endpoint = 'http://example.com:9292' test_client = http.HTTPClient(endpoint, token=u'adc123') actual = test_client.parse_endpoint(endpoint) - expected = parse.ParseResult(scheme='http', + expected = parse.SplitResult(scheme='http', netloc='example.com:9292', path='', - params='', query='', fragment='') + query='', fragment='') self.assertEqual(expected, actual) def test_get_connection_class(self):