diff --git a/requirements.txt b/requirements.txt index 9bf2d0e..d8c0f25 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,6 @@ # process, which may cause wedges in the gate later. pbr!=2.1.0,>=2.0.0 # Apache-2.0 -six>=1.10.0 # MIT keystoneauth1>=3.3.0 # Apache-2.0 stevedore>=1.20.0 # Apache-2.0 requests>=2.14.2 # Apache-2.0 diff --git a/venusclient/common/httpclient.py b/venusclient/common/httpclient.py index f6c95a4..b91efd6 100644 --- a/venusclient/common/httpclient.py +++ b/venusclient/common/httpclient.py @@ -16,6 +16,8 @@ # under the License. import copy +from http import client as http_client +from io import StringIO import json import logging import os @@ -24,8 +26,7 @@ import ssl from keystoneauth1 import adapter from oslo_utils import importutils -import six -import six.moves.urllib.parse as urlparse +import urllib.parse as urlparse from venusclient import exceptions @@ -93,7 +94,7 @@ class HTTPClient(object): _kwargs['key_file'] = kwargs.get('key_file', None) _kwargs['insecure'] = kwargs.get('insecure', False) elif parts.scheme == 'http': - _class = six.moves.http_client.HTTPConnection + _class = http_client.HTTPConnection else: msg = 'Unsupported scheme: %s' % parts.scheme raise exceptions.EndpointException(msg) @@ -194,7 +195,7 @@ class HTTPClient(object): ] body_str = ''.join(body_list) self.log_http_response(resp, body_str) - body_iter = six.StringIO(body_str) + body_iter = StringIO(body_str) else: self.log_http_response(resp) @@ -245,7 +246,7 @@ class HTTPClient(object): return self._http_request(url, method, **kwargs) -class VerifiedHTTPSConnection(six.moves.http_client.HTTPSConnection): +class VerifiedHTTPSConnection(http_client.HTTPSConnection): """httplib-compatibile connection using client-side SSL authentication :see http://code.activestate.com/recipes/ @@ -254,9 +255,9 @@ class VerifiedHTTPSConnection(six.moves.http_client.HTTPSConnection): def __init__(self, host, port, key_file=None, cert_file=None, ca_file=None, timeout=None, insecure=False): - six.moves.http_client.HTTPSConnection.__init__(self, host, port, - key_file=key_file, - cert_file=cert_file) + http_client.HTTPSConnection.__init__(self, host, port, + key_file=key_file, + cert_file=cert_file) self.key_file = key_file self.cert_file = cert_file if ca_file is not None: