Remove six from db module

This is part of the steps to remove usage of six library, which is no
longer needed since python 2 support was removed.

Change-Id: I529759167f960714ebf93be7b89ee849040361b2
This commit is contained in:
Takashi Kajinami
2024-02-17 11:48:37 +09:00
parent 41fa21d43c
commit 206d19ec52
3 changed files with 3 additions and 6 deletions

View File

@@ -19,7 +19,6 @@ import abc
from oslo_config import cfg from oslo_config import cfg
from oslo_db import api as db_api from oslo_db import api as db_api
import six
from magnum.common import profiler from magnum.common import profiler
@@ -35,8 +34,7 @@ def get_instance():
@profiler.trace_cls("db") @profiler.trace_cls("db")
@six.add_metaclass(abc.ABCMeta) class Connection(object, metaclass=abc.ABCMeta):
class Connection(object):
"""Base class for storage system connections.""" """Base class for storage system connections."""
@abc.abstractmethod @abc.abstractmethod

View File

@@ -13,7 +13,6 @@
# under the License. # under the License.
"""SQLAlchemy storage backend.""" """SQLAlchemy storage backend."""
import six
from oslo_db import exception as db_exc from oslo_db import exception as db_exc
from oslo_db.sqlalchemy import session as db_session from oslo_db.sqlalchemy import session as db_session
@@ -440,7 +439,7 @@ class Connection(api.Connection):
# NOTE(flwang): We only allow to update ClusterTemplate to be # NOTE(flwang): We only allow to update ClusterTemplate to be
# public, hidden and rename # public, hidden and rename
if (not self._is_publishing_cluster_template(values) and if (not self._is_publishing_cluster_template(values) and
list(six.viewkeys(values)) != ["name"]): list(values.keys()) != ["name"]):
raise exception.ClusterTemplateReferenced( raise exception.ClusterTemplateReferenced(
clustertemplate=cluster_template_id) clustertemplate=cluster_template_id)

View File

@@ -15,10 +15,10 @@
""" """
SQLAlchemy models for container service SQLAlchemy models for container service
""" """
from urllib import parse as urlparse
from oslo_db.sqlalchemy import models from oslo_db.sqlalchemy import models
from oslo_serialization import jsonutils from oslo_serialization import jsonutils
import six.moves.urllib.parse as urlparse
from sqlalchemy import Boolean from sqlalchemy import Boolean
from sqlalchemy import Column from sqlalchemy import Column
from sqlalchemy import DateTime from sqlalchemy import DateTime