from abc import ABCMeta, abstractmethod
-from six import StringIO
+from io import StringIO
import json
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
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 *
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, \
# 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"""
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 = []
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 *
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 *
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
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