Merge "Fix for invalid literal ValueError parsing ipv6 url(s)"
This commit is contained in:
commit
59b04bde11
|
@ -39,6 +39,7 @@ import OpenSSL
|
||||||
|
|
||||||
from glanceclient.common import utils
|
from glanceclient.common import utils
|
||||||
from glanceclient import exc
|
from glanceclient import exc
|
||||||
|
from glanceclient.openstack.common import network_utils
|
||||||
from glanceclient.openstack.common import strutils
|
from glanceclient.openstack.common import strutils
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -85,7 +86,7 @@ class HTTPClient(object):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def parse_endpoint(endpoint):
|
def parse_endpoint(endpoint):
|
||||||
return parse.urlparse(endpoint)
|
return network_utils.urlsplit(endpoint)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_connection_class(scheme):
|
def get_connection_class(scheme):
|
||||||
|
|
|
@ -304,9 +304,9 @@ class TestClient(testtools.TestCase):
|
||||||
endpoint = 'http://example.com:9292'
|
endpoint = 'http://example.com:9292'
|
||||||
test_client = http.HTTPClient(endpoint, token=u'adc123')
|
test_client = http.HTTPClient(endpoint, token=u'adc123')
|
||||||
actual = test_client.parse_endpoint(endpoint)
|
actual = test_client.parse_endpoint(endpoint)
|
||||||
expected = parse.ParseResult(scheme='http',
|
expected = parse.SplitResult(scheme='http',
|
||||||
netloc='example.com:9292', path='',
|
netloc='example.com:9292', path='',
|
||||||
params='', query='', fragment='')
|
query='', fragment='')
|
||||||
self.assertEqual(expected, actual)
|
self.assertEqual(expected, actual)
|
||||||
|
|
||||||
def test_get_connection_class(self):
|
def test_get_connection_class(self):
|
||||||
|
|
Loading…
Reference in New Issue