Remove six in files under cinder/*

Replace the following items with Python 3 style code.

- six.add_metaclass
- six.PY2
- six.text_type
- six.string_types
- six.wraps

Change-Id: I393ee1f1627a993021af395c02bb936a7a476aec
Implements: blueprint six-removal
This commit is contained in:
xuanyandong
2020-10-08 09:28:36 +08:00
parent 6ad1ab0c72
commit 04a2683b2d
5 changed files with 17 additions and 26 deletions

View File

@@ -26,7 +26,6 @@ from oslo_context import context
from oslo_db.sqlalchemy import enginefacade
from oslo_log import log as logging
from oslo_utils import timeutils
import six
from cinder import exception
from cinder.i18n import _
@@ -105,7 +104,7 @@ class RequestContext(context.RequestContext):
self.remote_address = remote_address
if not timestamp:
timestamp = timeutils.utcnow()
elif isinstance(timestamp, six.string_types):
elif isinstance(timestamp, str):
timestamp = timeutils.parse_isotime(timestamp)
self.timestamp = timestamp
self.quota_class = quota_class