Remove six of dir cinder/brick,cinder/common,cinder/interface,cinder/objects
Replace the following items with Python 3 style code. - six.moves - six.add_metaclass - six.string_types Change-Id: Ia46f5967c8e31a17a1614d164e41f8bd81e76f49 Implements: blueprint six-removal
This commit is contained in:
parent
6ad1ab0c72
commit
18d869276b
@ -25,7 +25,6 @@ from os_brick import executor
|
||||
from oslo_concurrency import processutils as putils
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import excutils
|
||||
from six import moves
|
||||
|
||||
from cinder import exception
|
||||
import cinder.privsep.lvm
|
||||
@ -311,7 +310,7 @@ class LVM(executor.Executor):
|
||||
lv_list = []
|
||||
if out is not None:
|
||||
volumes = out.split()
|
||||
iterator = moves.zip(*[iter(volumes)] * 3) # pylint: disable=E1101
|
||||
iterator = zip(*[iter(volumes)] * 3) # pylint: disable=E1101
|
||||
for vg, name, size in iterator:
|
||||
lv_list.append({"vg": vg, "name": name, "size": size})
|
||||
|
||||
|
@ -20,7 +20,6 @@
|
||||
import datetime
|
||||
|
||||
from oslo_log import log as logging
|
||||
from six.moves import range
|
||||
import sqlalchemy
|
||||
import sqlalchemy.sql as sa_sql
|
||||
from sqlalchemy.sql import type_api
|
||||
|
@ -17,8 +17,6 @@
|
||||
import abc
|
||||
import inspect
|
||||
|
||||
import six
|
||||
|
||||
if hasattr(inspect, 'getfullargspec'):
|
||||
getargspec = inspect.getfullargspec
|
||||
else:
|
||||
@ -59,8 +57,7 @@ def _get_method_info(cls):
|
||||
return result
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class CinderInterface(object):
|
||||
class CinderInterface(object, metaclass=abc.ABCMeta):
|
||||
"""Interface base class for Cinder.
|
||||
|
||||
Cinder interfaces should inherit from this class to support indirect
|
||||
|
@ -14,7 +14,6 @@
|
||||
|
||||
from oslo_utils import versionutils
|
||||
from oslo_versionedobjects import fields
|
||||
import six
|
||||
|
||||
from cinder import db
|
||||
from cinder import exception
|
||||
@ -94,7 +93,7 @@ class VolumeType(base.CinderPersistentObject, base.CinderObject,
|
||||
# have to do a conversion here for VolumeTypeProjects ORM instance
|
||||
# lists.
|
||||
projects = db_type.get('projects', [])
|
||||
if projects and not isinstance(projects[0], six.string_types):
|
||||
if projects and not isinstance(projects[0], str):
|
||||
projects = [p.project_id for p in projects]
|
||||
type.projects = projects
|
||||
if 'qos_specs' in expected_attrs:
|
||||
|
Loading…
x
Reference in New Issue
Block a user