Remove usage of six

Remove six-library Replace the following items with Python 3 style code.
- six.iterkeys
- six.moves
- six.metaclass

Change-Id: I2409f52daf24be1aab42a6d1f77db1c1bf1dc075
This commit is contained in:
root 2020-10-12 02:32:02 +00:00 committed by licanwei
parent 95a6f9568c
commit f5913409a5
4 changed files with 4 additions and 10 deletions

View File

@ -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
oslo.log>=3.36.0 # Apache-2.0
oslo.utils>=3.33.0 # Apache-2.0
tempest>=17.1.0 # Apache-2.0

View File

@ -17,7 +17,6 @@
import abc
from oslo_serialization import jsonutils as json
import six
from tempest import clients
from tempest.common import credentials_factory as creds_factory
from tempest import config
@ -30,8 +29,7 @@ from watcher_tempest_plugin.services.metric.v1.json import client as gc
CONF = config.CONF
@six.add_metaclass(abc.ABCMeta)
class BaseManager(clients.Manager):
class BaseManager(clients.Manager, metaclass=abc.ABCMeta):
def __init__(self, credentials):
super(BaseManager, self).__init__(credentials)

View File

@ -17,8 +17,7 @@
import abc
import functools
import six
import six.moves.urllib.parse as urlparse
import urllib.parse as urlparse
from tempest.lib.common import rest_client
@ -43,8 +42,7 @@ def handle_errors(f):
return wrapper
@six.add_metaclass(abc.ABCMeta)
class BaseClient(rest_client.RestClient):
class BaseClient(rest_client.RestClient, metaclass=abc.ABCMeta):
"""Base Tempest REST client for API."""
URI_PREFIX = ''

View File

@ -17,7 +17,6 @@ import shlex
import subprocess
import testtools
import six
from tempest import clients
from tempest.common import credentials_factory as creds_factory
from tempest.lib.cli import output_parser
@ -97,7 +96,7 @@ class TestCase(testtools.TestCase):
def assert_show_fields(self, items, field_names):
"""Verify that all items have keys listed in field_names."""
for item in items:
for key in six.iterkeys(item):
for key in item.keys():
self.assertIn(key, field_names)
def assert_show_structure(self, items, field_names):