diff --git a/magnum/api/controllers/base.py b/magnum/api/controllers/base.py index 48a13b635c..d8697c03f9 100644 --- a/magnum/api/controllers/base.py +++ b/magnum/api/controllers/base.py @@ -14,7 +14,6 @@ import datetime import operator -import six from magnum.api.controllers import versions from magnum.api import versioned_method @@ -90,8 +89,7 @@ class ControllerMetaclass(type): cls_dict) -@six.add_metaclass(ControllerMetaclass) -class Controller(rest.RestController): +class Controller(rest.RestController, metaclass=ControllerMetaclass): """Base Rest Controller""" def __getattribute__(self, key): diff --git a/magnum/api/controllers/v1/cluster.py b/magnum/api/controllers/v1/cluster.py index ae6595229b..cc4986a354 100644 --- a/magnum/api/controllers/v1/cluster.py +++ b/magnum/api/controllers/v1/cluster.py @@ -19,7 +19,6 @@ from oslo_log import log as logging from oslo_utils import strutils from oslo_utils import timeutils import pecan -import six import warnings import wsme from wsme import types as wtypes @@ -92,10 +91,10 @@ class Cluster(base.APIBase): docker_volume_size = wtypes.IntegerType(minimum=1) """The size in GB of the docker volume""" - labels = wtypes.DictType(wtypes.text, types.MultiType(wtypes.text, - six.integer_types, - bool, - float)) + labels = wtypes.DictType( + wtypes.text, + types.MultiType(wtypes.text, int, bool, float) + ) """One or more key/value pairs""" master_flavor_id = wtypes.StringType(min_length=1, max_length=255) @@ -167,17 +166,19 @@ class Cluster(base.APIBase): labels_overridden = wtypes.DictType( wtypes.text, types.MultiType( - wtypes.text, six.integer_types, bool, float)) + wtypes.text, int, bool, float)) """Contains labels that have a value different than the parent labels.""" labels_added = wtypes.DictType( - wtypes.text, types.MultiType( - wtypes.text, six.integer_types, bool, float)) + wtypes.text, + types.MultiType(wtypes.text, int, bool, float) + ) """Contains labels that do not exist in the parent.""" labels_skipped = wtypes.DictType( - wtypes.text, types.MultiType( - wtypes.text, six.integer_types, bool, float)) + wtypes.text, + types.MultiType(wtypes.text, int, bool, float) + ) """Contains labels that exist in the parent but were not inherited.""" master_lb_enabled = wsme.wsattr(types.boolean) diff --git a/magnum/api/controllers/v1/cluster_template.py b/magnum/api/controllers/v1/cluster_template.py index de764b2ad9..87b5ae89f3 100644 --- a/magnum/api/controllers/v1/cluster_template.py +++ b/magnum/api/controllers/v1/cluster_template.py @@ -15,7 +15,6 @@ from oslo_log import log as logging from oslo_utils import timeutils import pecan -import six import warnings import wsme from wsme import types as wtypes @@ -117,10 +116,10 @@ class ClusterTemplate(base.APIBase): registry_enabled = wsme.wsattr(types.boolean, default=False) """Indicates whether the docker registry is enabled""" - labels = wtypes.DictType(wtypes.text, types.MultiType(wtypes.text, - six.integer_types, - bool, - float)) + labels = wtypes.DictType( + wtypes.text, + types.MultiType(wtypes.text, int, bool, float) + ) """One or more key/value pairs""" tls_disabled = wsme.wsattr(types.boolean, default=False) diff --git a/magnum/api/controllers/v1/nodegroup.py b/magnum/api/controllers/v1/nodegroup.py index 260c80c38e..dd7a1b9f87 100644 --- a/magnum/api/controllers/v1/nodegroup.py +++ b/magnum/api/controllers/v1/nodegroup.py @@ -14,7 +14,6 @@ # under the License. import pecan -import six import uuid import wsme from wsme import types as wtypes @@ -80,10 +79,10 @@ class NodeGroup(base.APIBase): docker_volume_size = wtypes.IntegerType(minimum=1) """The size in GB of the docker volume""" - labels = wtypes.DictType(wtypes.text, types.MultiType(wtypes.text, - six.integer_types, - bool, - float)) + labels = wtypes.DictType( + wtypes.text, + types.MultiType(wtypes.text, int, bool, float) + ) """One or more key/value pairs""" links = wsme.wsattr([link.Link], readonly=True) @@ -130,18 +129,21 @@ class NodeGroup(base.APIBase): """Indicates whether the labels will be merged with the cluster labels.""" labels_overridden = wtypes.DictType( - wtypes.text, types.MultiType( - wtypes.text, six.integer_types, bool, float)) + wtypes.text, + types.MultiType(wtypes.text, int, bool, float) + ) """Contains labels that have a value different than the parent labels.""" labels_added = wtypes.DictType( - wtypes.text, types.MultiType( - wtypes.text, six.integer_types, bool, float)) + wtypes.text, + types.MultiType(wtypes.text, int, bool, float) + ) """Contains labels that do not exist in the parent.""" labels_skipped = wtypes.DictType( - wtypes.text, types.MultiType( - wtypes.text, six.integer_types, bool, float)) + wtypes.text, + types.MultiType(wtypes.text, int, bool, float) + ) """Contains labels that exist in the parent but were not inherited.""" def __init__(self, **kwargs): diff --git a/magnum/api/controllers/v1/types.py b/magnum/api/controllers/v1/types.py index 5fa6c51fe4..832116e66a 100644 --- a/magnum/api/controllers/v1/types.py +++ b/magnum/api/controllers/v1/types.py @@ -14,7 +14,6 @@ # under the License. import inspect -import six from oslo_utils import strutils from oslo_utils import uuidutils @@ -29,7 +28,7 @@ from magnum.i18n import _ class DNSListType(wtypes.UserType): """A comman delimited dns nameserver list""" - basetype = six.string_types + basetype = str name = "dnslist" @staticmethod