Remove six

Remove six.moves Replace the following items with Python 3 style code.

- six.moves.urllib
- six.iteritems

Change-Id: I65d7a43ac9ae76e0634b72c6bb54cb3a98bd7aab
This commit is contained in:
wangzihao
2020-10-22 10:58:01 +08:00
committed by Dale Smith
parent 0930120e83
commit b89a07b5a1
9 changed files with 13 additions and 18 deletions

View File

@@ -21,11 +21,10 @@ Base utilities to build API operation managers and objects on top of.
"""
import abc
import copy
import six
from oslo_utils import reflection
from oslo_utils import strutils
from six.moves.urllib import parse
from urllib import parse
from adjutantclient._i18n import _
from adjutantclient import exc as exceptions
@@ -207,8 +206,7 @@ class BaseManager(HookableMixin):
return self.client.delete(url)
@six.add_metaclass(abc.ABCMeta)
class ManagerWithFind(BaseManager):
class ManagerWithFind(BaseManager, metaclass=abc.ABCMeta):
"""Manager with additional `find()`/`findall()` methods."""
@abc.abstractmethod

View File

@@ -13,7 +13,6 @@
# under the License.
import logging
import six
from osc_lib.command import command
from osc_lib.i18n import _
@@ -61,9 +60,8 @@ class QuotaShow(command.Lister):
region = quota_data['regions'][0]
rows = []
for service, service_detail in six.iteritems(
region['current_usage']):
for resource, value in six.iteritems(service_detail):
for service, service_detail in region['current_usage'].items():
for resource, value in service_detail.items():
current_quota = region['current_quota'][service].get(
resource)
rows.append([service, resource, current_quota, value])
@@ -82,9 +80,9 @@ class QuotaSizes(command.Lister):
'Size Name', 'Service', 'Resource', 'Value']
rows = []
for size, size_details in six.iteritems(quota_data['quota_sizes']):
for service, service_details in six.iteritems(size_details):
for resource, value in six.iteritems(service_details):
for size, size_details in quota_data['quota_sizes'].items():
for service, service_details in size_details.items():
for resource, value in service_details.items():
rows.append([size, service, resource, value])
return headers, rows

View File

@@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from six.moves.urllib import parse
from urllib import parse
from adjutantclient.common import base

View File

@@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from six.moves.urllib import parse
from urllib import parse
from adjutantclient.common import base

View File

@@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from six.moves.urllib import parse
from urllib import parse
from adjutantclient.common import base
from adjutantclient import exc

View File

@@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from six.moves.urllib import parse
from urllib import parse
from adjutantclient.common import base

View File

@@ -14,7 +14,7 @@
from adjutantclient.common import base
from six.moves.urllib import parse
from urllib import parse
class Token(base.Resource):

View File

@@ -13,7 +13,7 @@
# under the License.
from six.moves.urllib import parse
from moves.urllib import parse
from adjutantclient.common import base

View File

@@ -14,4 +14,3 @@ oslo.utils>=3.20.0 # Apache-2.0
keystoneauth1>=2.20.0 # Apache-2.0
PyYAML>=3.10.0 # MIT
requests!=2.12.2,!=2.13.0,>=2.10.0 # Apache-2.0
six>=1.9.0 # MIT