Browse Source

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
changes/67/757367/2 2.2.0
root 6 months ago
committed by licanwei
parent
commit
f5913409a5
4 changed files with 4 additions and 10 deletions
  1. +0
    -1
      requirements.txt
  2. +1
    -3
      watcher_tempest_plugin/infra_optim_clients.py
  3. +2
    -4
      watcher_tempest_plugin/services/base.py
  4. +1
    -2
      watcher_tempest_plugin/tests/client_functional/v1/base.py

+ 0
- 1
requirements.txt 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


+ 1
- 3
watcher_tempest_plugin/infra_optim_clients.py 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)


+ 2
- 4
watcher_tempest_plugin/services/base.py 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 = ''


+ 1
- 2
watcher_tempest_plugin/tests/client_functional/v1/base.py 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):


Loading…
Cancel
Save