Remove usage of six

Remove six-library Replace the following items with Python 3 style code.
- six.add_metaclass

Change-Id: I7da3e8898e00bc07f6e462cbc9765ce7c199faa2
changes/43/769243/3
songwenping 2 years ago committed by Wenping Song
parent 76f63460b3
commit 4c3bf8f800
  1. 4
      tempest/lib/auth.py
  2. 4
      tempest/lib/common/cred_client.py
  3. 4
      tempest/lib/common/cred_provider.py
  4. 4
      tempest/test_discover/plugins.py
  5. 4
      tempest/tests/lib/test_decorators.py

@ -21,7 +21,6 @@ import re
from urllib import parse as urlparse
from oslo_log import log as logging
import six
from tempest.lib import exceptions
from tempest.lib.services.identity.v2 import token_client as json_v2id
@ -65,8 +64,7 @@ def apply_url_filters(url, filters):
return url
@six.add_metaclass(abc.ABCMeta)
class AuthProvider(object):
class AuthProvider(object, metaclass=abc.ABCMeta):
"""Provide authentication"""
SCOPES = set(['project'])

@ -13,7 +13,6 @@
import abc
from oslo_log import log as logging
import six
from tempest.lib import auth
from tempest.lib import exceptions as lib_exc
@ -22,8 +21,7 @@ from tempest.lib.services.identity.v2 import identity_client as v2_identity
LOG = logging.getLogger(__name__)
@six.add_metaclass(abc.ABCMeta)
class CredsClient(object):
class CredsClient(object, metaclass=abc.ABCMeta):
"""This class is a wrapper around the identity clients
to provide a single interface for managing credentials in both v2 and v3

@ -14,14 +14,12 @@
import abc
import six
from tempest.lib import auth
from tempest.lib import exceptions
@six.add_metaclass(abc.ABCMeta)
class CredentialProvider(object):
class CredentialProvider(object, metaclass=abc.ABCMeta):
def __init__(self, identity_version, name=None,
network_resources=None, credentials_domain=None,
admin_role=None, identity_uri=None):

@ -15,7 +15,6 @@
import abc
from oslo_log import log as logging
import six
import stevedore
from tempest.lib.common.utils import misc
@ -24,8 +23,7 @@ from tempest.lib.services import clients
LOG = logging.getLogger(__name__)
@six.add_metaclass(abc.ABCMeta)
class TempestPlugin(object):
class TempestPlugin(object, metaclass=abc.ABCMeta):
"""Provide basic hooks for an external plugin
To provide tempest the necessary information to run the plugin.

@ -16,7 +16,6 @@
import abc
from unittest import mock
import six
import testtools
from tempest.lib import base as test
@ -69,8 +68,7 @@ class TestAttrDecorator(base.TestCase):
condition=True)
@six.add_metaclass(abc.ABCMeta)
class BaseSkipDecoratorTests(object):
class BaseSkipDecoratorTests(object, metaclass=abc.ABCMeta):
@abc.abstractmethod
def _test_skip_helper(self, raise_exception=True, expected_to_skip=True,

Loading…
Cancel
Save