Merge "Fix https stack trace on python 3.4 client"

This commit is contained in:
Jenkins
2015-04-15 11:07:38 +00:00
committed by Gerrit Code Review
2 changed files with 3 additions and 8 deletions

View File

@@ -158,7 +158,9 @@ class HTTPSAdapter(adapters.HTTPAdapter):
# NOTE(flaper87): Make sure the url is encoded, otherwise
# python's standard httplib will fail with a TypeError.
url = super(HTTPSAdapter, self).request_url(request, proxies)
return encodeutils.safe_encode(url)
if six.PY2:
url = encodeutils.safe_encode(url)
return url
def _create_glance_httpsconnectionpool(self, url):
kw = self.poolmanager.connection_kw

View File

@@ -84,11 +84,6 @@ class TestHTTPSVerifyCert(testtools.TestCase):
server_thread.daemon = True
server_thread.start()
def _skip_python3(self):
if six.PY3:
msg = ("Skipping: python3 for now. Requires bugfix.")
self.skipTest(msg)
def test_v1_requests_cert_verification(self):
"""v1 regression test for bug 115260."""
port = self.port
@@ -108,7 +103,6 @@ class TestHTTPSVerifyCert(testtools.TestCase):
def test_v1_requests_cert_verification_no_compression(self):
"""v1 regression test for bug 115260."""
self._skip_python3()
port = self.port
url = 'https://0.0.0.0:%d' % port
@@ -143,7 +137,6 @@ class TestHTTPSVerifyCert(testtools.TestCase):
def test_v2_requests_cert_verification_no_compression(self):
"""v2 regression test for bug 115260."""
self._skip_python3()
port = self.port
url = 'https://0.0.0.0:%d' % port