Remove six from api 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: I4c80bdf8f90a920a05f051a922dfb5db925f0649
This commit is contained in:
parent
68c8acba39
commit
52ee359f08
|
@ -14,7 +14,6 @@
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
import operator
|
import operator
|
||||||
import six
|
|
||||||
|
|
||||||
from magnum.api.controllers import versions
|
from magnum.api.controllers import versions
|
||||||
from magnum.api import versioned_method
|
from magnum.api import versioned_method
|
||||||
|
@ -90,8 +89,7 @@ class ControllerMetaclass(type):
|
||||||
cls_dict)
|
cls_dict)
|
||||||
|
|
||||||
|
|
||||||
@six.add_metaclass(ControllerMetaclass)
|
class Controller(rest.RestController, metaclass=ControllerMetaclass):
|
||||||
class Controller(rest.RestController):
|
|
||||||
"""Base Rest Controller"""
|
"""Base Rest Controller"""
|
||||||
|
|
||||||
def __getattribute__(self, key):
|
def __getattribute__(self, key):
|
||||||
|
|
|
@ -19,7 +19,6 @@ from oslo_log import log as logging
|
||||||
from oslo_utils import strutils
|
from oslo_utils import strutils
|
||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
import pecan
|
import pecan
|
||||||
import six
|
|
||||||
import warnings
|
import warnings
|
||||||
import wsme
|
import wsme
|
||||||
from wsme import types as wtypes
|
from wsme import types as wtypes
|
||||||
|
@ -92,10 +91,10 @@ class Cluster(base.APIBase):
|
||||||
docker_volume_size = wtypes.IntegerType(minimum=1)
|
docker_volume_size = wtypes.IntegerType(minimum=1)
|
||||||
"""The size in GB of the docker volume"""
|
"""The size in GB of the docker volume"""
|
||||||
|
|
||||||
labels = wtypes.DictType(wtypes.text, types.MultiType(wtypes.text,
|
labels = wtypes.DictType(
|
||||||
six.integer_types,
|
wtypes.text,
|
||||||
bool,
|
types.MultiType(wtypes.text, int, bool, float)
|
||||||
float))
|
)
|
||||||
"""One or more key/value pairs"""
|
"""One or more key/value pairs"""
|
||||||
|
|
||||||
master_flavor_id = wtypes.StringType(min_length=1, max_length=255)
|
master_flavor_id = wtypes.StringType(min_length=1, max_length=255)
|
||||||
|
@ -167,17 +166,19 @@ class Cluster(base.APIBase):
|
||||||
|
|
||||||
labels_overridden = wtypes.DictType(
|
labels_overridden = wtypes.DictType(
|
||||||
wtypes.text, types.MultiType(
|
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."""
|
"""Contains labels that have a value different than the parent labels."""
|
||||||
|
|
||||||
labels_added = wtypes.DictType(
|
labels_added = wtypes.DictType(
|
||||||
wtypes.text, types.MultiType(
|
wtypes.text,
|
||||||
wtypes.text, six.integer_types, bool, float))
|
types.MultiType(wtypes.text, int, bool, float)
|
||||||
|
)
|
||||||
"""Contains labels that do not exist in the parent."""
|
"""Contains labels that do not exist in the parent."""
|
||||||
|
|
||||||
labels_skipped = wtypes.DictType(
|
labels_skipped = wtypes.DictType(
|
||||||
wtypes.text, types.MultiType(
|
wtypes.text,
|
||||||
wtypes.text, six.integer_types, bool, float))
|
types.MultiType(wtypes.text, int, bool, float)
|
||||||
|
)
|
||||||
"""Contains labels that exist in the parent but were not inherited."""
|
"""Contains labels that exist in the parent but were not inherited."""
|
||||||
|
|
||||||
master_lb_enabled = wsme.wsattr(types.boolean)
|
master_lb_enabled = wsme.wsattr(types.boolean)
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
import pecan
|
import pecan
|
||||||
import six
|
|
||||||
import warnings
|
import warnings
|
||||||
import wsme
|
import wsme
|
||||||
from wsme import types as wtypes
|
from wsme import types as wtypes
|
||||||
|
@ -117,10 +116,10 @@ class ClusterTemplate(base.APIBase):
|
||||||
registry_enabled = wsme.wsattr(types.boolean, default=False)
|
registry_enabled = wsme.wsattr(types.boolean, default=False)
|
||||||
"""Indicates whether the docker registry is enabled"""
|
"""Indicates whether the docker registry is enabled"""
|
||||||
|
|
||||||
labels = wtypes.DictType(wtypes.text, types.MultiType(wtypes.text,
|
labels = wtypes.DictType(
|
||||||
six.integer_types,
|
wtypes.text,
|
||||||
bool,
|
types.MultiType(wtypes.text, int, bool, float)
|
||||||
float))
|
)
|
||||||
"""One or more key/value pairs"""
|
"""One or more key/value pairs"""
|
||||||
|
|
||||||
tls_disabled = wsme.wsattr(types.boolean, default=False)
|
tls_disabled = wsme.wsattr(types.boolean, default=False)
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import pecan
|
import pecan
|
||||||
import six
|
|
||||||
import uuid
|
import uuid
|
||||||
import wsme
|
import wsme
|
||||||
from wsme import types as wtypes
|
from wsme import types as wtypes
|
||||||
|
@ -80,10 +79,10 @@ class NodeGroup(base.APIBase):
|
||||||
docker_volume_size = wtypes.IntegerType(minimum=1)
|
docker_volume_size = wtypes.IntegerType(minimum=1)
|
||||||
"""The size in GB of the docker volume"""
|
"""The size in GB of the docker volume"""
|
||||||
|
|
||||||
labels = wtypes.DictType(wtypes.text, types.MultiType(wtypes.text,
|
labels = wtypes.DictType(
|
||||||
six.integer_types,
|
wtypes.text,
|
||||||
bool,
|
types.MultiType(wtypes.text, int, bool, float)
|
||||||
float))
|
)
|
||||||
"""One or more key/value pairs"""
|
"""One or more key/value pairs"""
|
||||||
|
|
||||||
links = wsme.wsattr([link.Link], readonly=True)
|
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."""
|
"""Indicates whether the labels will be merged with the cluster labels."""
|
||||||
|
|
||||||
labels_overridden = wtypes.DictType(
|
labels_overridden = wtypes.DictType(
|
||||||
wtypes.text, types.MultiType(
|
wtypes.text,
|
||||||
wtypes.text, six.integer_types, bool, float))
|
types.MultiType(wtypes.text, int, bool, float)
|
||||||
|
)
|
||||||
"""Contains labels that have a value different than the parent labels."""
|
"""Contains labels that have a value different than the parent labels."""
|
||||||
|
|
||||||
labels_added = wtypes.DictType(
|
labels_added = wtypes.DictType(
|
||||||
wtypes.text, types.MultiType(
|
wtypes.text,
|
||||||
wtypes.text, six.integer_types, bool, float))
|
types.MultiType(wtypes.text, int, bool, float)
|
||||||
|
)
|
||||||
"""Contains labels that do not exist in the parent."""
|
"""Contains labels that do not exist in the parent."""
|
||||||
|
|
||||||
labels_skipped = wtypes.DictType(
|
labels_skipped = wtypes.DictType(
|
||||||
wtypes.text, types.MultiType(
|
wtypes.text,
|
||||||
wtypes.text, six.integer_types, bool, float))
|
types.MultiType(wtypes.text, int, bool, float)
|
||||||
|
)
|
||||||
"""Contains labels that exist in the parent but were not inherited."""
|
"""Contains labels that exist in the parent but were not inherited."""
|
||||||
|
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import inspect
|
import inspect
|
||||||
import six
|
|
||||||
|
|
||||||
from oslo_utils import strutils
|
from oslo_utils import strutils
|
||||||
from oslo_utils import uuidutils
|
from oslo_utils import uuidutils
|
||||||
|
@ -29,7 +28,7 @@ from magnum.i18n import _
|
||||||
class DNSListType(wtypes.UserType):
|
class DNSListType(wtypes.UserType):
|
||||||
"""A comman delimited dns nameserver list"""
|
"""A comman delimited dns nameserver list"""
|
||||||
|
|
||||||
basetype = six.string_types
|
basetype = str
|
||||||
name = "dnslist"
|
name = "dnslist"
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
Loading…
Reference in New Issue