Remove six

Replace the following items with Python 3 style code.
- six.moves.BaseHttpServer
- six.moves.zip
- six.PY2
- six.viewitems

Change-Id: If68cc2778bfccc56248ab8fba3de764044a707e9
This commit is contained in:
Q.hongtao 2020-09-21 09:10:44 +08:00
parent 1c8905a717
commit 1203b762fa
5 changed files with 3 additions and 12 deletions

View File

@ -17,7 +17,6 @@ python-novaclient>=10.1.0 # Apache-2.0
python-mistralclient>=3.3.0 # Apache-2.0
python-glanceclient>=2.8.0 # Apache-2.0
python-vitrageclient>=2.0.0 # Apache-2.0
six>=1.10.0 # MIT
oslo.config>=5.2.0 # Apache-2.0
oslo.serialization!=2.19.1,>=2.18.0 # Apache-2.0
oslo.log>=3.36.0 # Apache-2.0

View File

@ -12,7 +12,6 @@
# License for the specific language governing permissions and limitations
# under the License.
import six
from datetime import datetime
from oslo_log import log as logging
@ -57,7 +56,7 @@ class TestEvents(BaseTestEvents):
'Expected host down alarm')
alarm = api_alarms[0]
event_time_tz = six.u(event_time.strftime('%Y-%m-%dT%H:%M:%SZ'))
event_time_tz = str(event_time.strftime('%Y-%m-%dT%H:%M:%SZ'))
self._check_alarm(alarm, event_time_tz, event_type, details)
event_time = datetime.now()

View File

@ -18,8 +18,6 @@ from itertools import islice
import networkx as nx
from networkx.readwrite import json_graph
import six
from six.moves import zip
from oslo_log import log as logging
from oslo_utils import timeutils
@ -56,10 +54,6 @@ LOG = logging.getLogger(__name__)
IsEmpty = lambda: HasLength(0)
IsNotEmpty = lambda: Not(IsEmpty())
if six.PY2:
class ResourceWarning(Warning):
pass
class BaseVitrageTempest(test.BaseTestCase):
"""Base test class for All Vitrage tests."""

View File

@ -12,7 +12,6 @@
# License for the specific language governing permissions and limitations
# under the License.
from os import path
import six
def first_match(list_of_dicts, **kwargs):
@ -33,7 +32,7 @@ def is_subset(subset, full):
full_dict = full
if type(full) is not dict:
full_dict = vars(full)
return six.viewitems(subset) <= six.viewitems(full_dict)
return subset.items() <= full_dict.items()
def _remove_none_values(**kwargs):

View File

@ -13,9 +13,9 @@
# under the License.
import ast
import http.server as BaseHTTPServer
from oslo_log import log as logging
import requests
from six.moves import BaseHTTPServer
import socket
from testtools import matchers
from threading import Thread