]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
test/rgw/rgw_multi: drop python2 support
authorKefu Chai <kchai@redhat.com>
Sun, 19 Jul 2020 08:50:44 +0000 (16:50 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 21 Jul 2020 11:52:11 +0000 (19:52 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/test/rgw/rgw_multi/multisite.py
src/test/rgw/rgw_multi/tests.py
src/test/rgw/rgw_multi/tests_es.py
src/test/rgw/rgw_multi/tests_ps.py
src/test/rgw/rgw_multi/zone_cloud.py
src/test/rgw/rgw_multi/zone_es.py
src/test/rgw/rgw_multi/zone_ps.py
src/test/rgw/rgw_multi/zone_rados.py

index d591f340e64cf79c707f42e62ca63555b8e692bb..25ddda5322cf38ba03b3700d2706949acbc94f0b 100644 (file)
@@ -1,5 +1,5 @@
 from abc import ABCMeta, abstractmethod
-from six import StringIO
+from io import StringIO
 
 import json
 
index 018aa4bd4ec48b6c4e33948b2bf069af7f085e61..37694977cd25d68bf4e032b94963b4b44343444e 100644 (file)
@@ -6,13 +6,8 @@ import time
 import logging
 import errno
 
-try:
-    from itertools import izip_longest as zip_longest  # type: ignore
-except ImportError:
-    from itertools import zip_longest
 from itertools import combinations
-from six import StringIO
-from six.moves import range
+from io import StringIO
 
 import boto
 import boto.s3.connection
index 1854c4cfedb02ac45bd303d9df4ffa04df7201e9..08c11718bd04967ccdc8e60feebf0bc852002a08 100644 (file)
@@ -7,8 +7,9 @@ import boto.s3.connection
 import datetime
 import dateutil
 
+from itertools import zip_longest  # type: ignore
+
 from nose.tools import eq_ as eq
-from six.moves import range
 
 from .multisite import *
 from .tests import *
index 8b5fc1d41c2d97bb0d92518e3a003a3086317442..dcc94760721216bb05365d08cfbf1b7636611049 100644 (file)
@@ -1,13 +1,13 @@
 import logging
 import json
 import tempfile
-from six.moves import BaseHTTPServer
 import random
 import threading
 import subprocess
 import socket
 import time
 import os
+from http import server as http_server
 from random import randint
 from .tests import get_realm, \
     ZonegroupConns, \
@@ -54,7 +54,7 @@ def set_contents_from_string(key, content):
 # HTTP endpoint functions
 # multithreaded streaming server, based on: https://stackoverflow.com/questions/46210672/
 
-class HTTPPostHandler(BaseHTTPServer.BaseHTTPRequestHandler):
+class HTTPPostHandler(http_server.BaseHTTPRequestHandler):
     """HTTP POST hanler class storing the received events in its http server"""
     def do_POST(self):
         """implementation of POST handler"""
@@ -72,10 +72,10 @@ class HTTPPostHandler(BaseHTTPServer.BaseHTTPRequestHandler):
             self.end_headers()
 
 
-class HTTPServerWithEvents(BaseHTTPServer.HTTPServer):
+class HTTPServerWithEvents(http_server.HTTPServer):
     """HTTP server used by the handler to store events"""
     def __init__(self, addr, handler, worker_id):
-        BaseHTTPServer.HTTPServer.__init__(self, addr, handler, False)
+        http_server.HTTPServer.__init__(self, addr, handler, False)
         self.worker_id = worker_id
         self.events = []
 
index eb945a44bc21d248430a50d38b2313fb0cc20c1f..322a19e6d1807a9559c5d7c332e1eefac585e811 100644 (file)
@@ -11,12 +11,8 @@ import datetime
 import re
 
 from nose.tools import eq_ as eq
-try:
-    from itertools import izip_longest as zip_longest  # type: ignore
-except ImportError:
-    from itertools import zip_longest
-
-from six.moves.urllib.parse import urlparse
+from itertools import zip_longest # type: ignore
+from urllib.parse import urlparse
 
 from .multisite import *
 from .tools import *
index 7ba31a43078982523b384bfe87d21e6e48a0190f..204b9e47f2e3ee8dfcbe35d41c854d1d13b233c0 100644 (file)
@@ -8,10 +8,7 @@ import boto.s3.connection
 import dateutil.parser
 
 from nose.tools import eq_ as eq
-try:
-    from itertools import izip_longest as zip_longest  # type: ignore
-except ImportError:
-    from itertools import zip_longest
+from itertools import zip_longest  # type: ignore
 
 from .multisite import *
 from .tools import *
index 84413f5565d8ff6211c1e2784936f8ad58080877..241bbe8a26e2faec580e80d111afd82f5ee00031 100644 (file)
@@ -5,8 +5,8 @@ import hmac
 import hashlib
 import base64
 import xmltodict
-from six.moves import http_client
-from six.moves.urllib import parse as urlparse
+from http import client as http_client
+from urllib import parse as urlparse
 from time import gmtime, strftime
 from .multisite import Zone
 import boto3
index 3b298e8b42f78c2f55d71dbf44a58afd83d04c53..984b0c2ffca06d06bc34325343f8423412d4a691 100644 (file)
@@ -1,10 +1,7 @@
 import logging
 from boto.s3.deletemarker import DeleteMarker
 
-try:
-    from itertools import izip_longest as zip_longest  # type: ignore
-except ImportError:
-    from itertools import zip_longest
+from itertools import zip_longest  # type: ignore
 
 from nose.tools import eq_ as eq