diff --git a/senlin/common/consts.py b/senlin/common/consts.py index b07f50507..0805f9b08 100644 --- a/senlin/common/consts.py +++ b/senlin/common/consts.py @@ -34,6 +34,12 @@ RPC_PARAMS = ( 'show_details', 'sort', ) +SUPPORT_STATUSES = ( + EXPERIMENTAL, SUPPORTED, DEPRECATING, UNSUPPORTED, +) = ( + 'experimental', 'supported', 'deprecated', 'unsupported', +) + ACTION_CAUSES = ( CAUSE_RPC, CAUSE_DERIVED, ) = ( diff --git a/senlin/policies/affinity_policy.py b/senlin/policies/affinity_policy.py index 77d212a3c..0ea9d9bc8 100644 --- a/senlin/policies/affinity_policy.py +++ b/senlin/policies/affinity_policy.py @@ -44,9 +44,12 @@ class AffinityPolicy(base.Policy): This policy is expected to be enforced before new member(s) added to an existing cluster. """ - VERSION = '1.0' - + VERSIONS = { + '1.0': [ + {'status': consts.SUPPORTED, 'since': '2016.10'} + ] + } PRIORITY = 300 TARGET = [ diff --git a/senlin/policies/base.py b/senlin/policies/base.py index 80105a9ba..552b49ea5 100644 --- a/senlin/policies/base.py +++ b/senlin/policies/base.py @@ -32,7 +32,10 @@ CHECK_RESULTS = ( class Policy(object): - '''Base class for policies.''' + """Base class for policies.""" + + VERSIONS = {} + PROFILE_TYPE = 'ANY' KEYS = ( diff --git a/senlin/policies/batch_policy.py b/senlin/policies/batch_policy.py index 14a4be1d7..ce5de5676 100644 --- a/senlin/policies/batch_policy.py +++ b/senlin/policies/batch_policy.py @@ -51,7 +51,11 @@ class BatchPolicy(base.Policy): """Policy for batching the operations on a cluster's nodes.""" VERSION = '1.0' - + VERSIONS = { + '1.0': [ + {'status': consts.EXPERIMENTAL, 'since': '2017.02'} + ] + } PRIORITY = 200 TARGET = [ diff --git a/senlin/policies/deletion_policy.py b/senlin/policies/deletion_policy.py index f8da1b65f..a3d0fd379 100644 --- a/senlin/policies/deletion_policy.py +++ b/senlin/policies/deletion_policy.py @@ -40,7 +40,11 @@ class DeletionPolicy(base.Policy): """ VERSION = '1.0' - + VERSIONS = { + '1.0': [ + {'status': consts.SUPPORTED, 'since': '2016.04'} + ] + } PRIORITY = 400 KEYS = ( diff --git a/senlin/policies/health_policy.py b/senlin/policies/health_policy.py index f7aed0a26..e3d4ed877 100644 --- a/senlin/policies/health_policy.py +++ b/senlin/policies/health_policy.py @@ -26,7 +26,11 @@ class HealthPolicy(base.Policy): """Policy for health management of a cluster.""" VERSION = '1.0' - + VERSIONS = { + '1.0': [ + {'status': consts.EXPERIMENTAL, 'since': '2017.02'} + ] + } PRIORITY = 600 TARGET = [ diff --git a/senlin/policies/lb_policy.py b/senlin/policies/lb_policy.py index a16d24179..729a7ec05 100644 --- a/senlin/policies/lb_policy.py +++ b/senlin/policies/lb_policy.py @@ -45,6 +45,11 @@ class LoadBalancingPolicy(base.Policy): performed. """ VERSION = '1.1' + VERSIONS = { + '1.0': [ + {'status': consts.SUPPORTED, 'since': '2016.04'} + ] + } PRIORITY = 500 diff --git a/senlin/policies/region_placement.py b/senlin/policies/region_placement.py index 8acf7d191..fdf4d38ab 100644 --- a/senlin/policies/region_placement.py +++ b/senlin/policies/region_placement.py @@ -37,6 +37,12 @@ class RegionPlacementPolicy(base.Policy): """Policy for placing members of a cluster across multiple regions.""" VERSION = '1.0' + VERSIONS = { + '1.0': [ + {'status': consts.EXPERIMENTAL, 'since': '2016.04'}, + {'status': consts.SUPPORTED, 'since': '2016.10'}, + ] + } PRIORITY = 200 diff --git a/senlin/policies/zone_placement.py b/senlin/policies/zone_placement.py index ea69e17d5..7dbca91b5 100644 --- a/senlin/policies/zone_placement.py +++ b/senlin/policies/zone_placement.py @@ -39,7 +39,12 @@ class ZonePlacementPolicy(base.Policy): """Policy for placing members of a cluster across availability zones.""" VERSION = '1.0' - + VERSIONS = { + '1.0': [ + {'status': consts.EXPERIMENTAL, 'since': '2016.04'}, + {'status': consts.SUPPORTED, 'since': '2016.10'}, + ] + } PRIORITY = 300 TARGET = [ diff --git a/senlin/profiles/base.py b/senlin/profiles/base.py index 642cfa5eb..05ab9b7c5 100644 --- a/senlin/profiles/base.py +++ b/senlin/profiles/base.py @@ -33,7 +33,9 @@ LOG = logging.getLogger(__name__) class Profile(object): - '''Base class for profiles.''' + """Base class for profiles.""" + + VERSIONS = {} KEYS = ( TYPE, VERSION, PROPERTIES, diff --git a/senlin/profiles/container/docker.py b/senlin/profiles/container/docker.py index 83e795823..d20623ba2 100644 --- a/senlin/profiles/container/docker.py +++ b/senlin/profiles/container/docker.py @@ -13,6 +13,7 @@ import random import six +from senlin.common import consts from senlin.common import context from senlin.common import exception as exc from senlin.common.i18n import _ @@ -29,6 +30,11 @@ from senlin.profiles import base class DockerProfile(base.Profile): """Profile for a docker container.""" + VERSIONS = { + '1.0': [ + {'status': consts.EXPERIMENTAL, 'since': '2017.02'} + ] + } _VALID_HOST_TYPES = [ HOST_NOVA_SERVER, HOST_HEAT_STACK, diff --git a/senlin/profiles/os/heat/stack.py b/senlin/profiles/os/heat/stack.py index 1570ce10e..6685d4209 100644 --- a/senlin/profiles/os/heat/stack.py +++ b/senlin/profiles/os/heat/stack.py @@ -13,6 +13,7 @@ from oslo_log import log as logging import six +from senlin.common import consts from senlin.common import exception as exc from senlin.common.i18n import _, _LE from senlin.common import schema @@ -23,11 +24,13 @@ LOG = logging.getLogger(__name__) class StackProfile(base.Profile): - '''Profile for an OpenStack Heat stack. + """Profile for an OpenStack Heat stack.""" - When this profile is used, the whole cluster is a collection of Heat - stacks. - ''' + VERSIONS = { + '1.0': [ + {'status': consts.SUPPORTED, 'since': '2016.04'} + ] + } KEYS = ( CONTEXT, TEMPLATE, TEMPLATE_URL, PARAMETERS, diff --git a/senlin/profiles/os/nova/server.py b/senlin/profiles/os/nova/server.py index 806ebc145..6be95b757 100644 --- a/senlin/profiles/os/nova/server.py +++ b/senlin/profiles/os/nova/server.py @@ -17,6 +17,7 @@ from oslo_utils import encodeutils import six from senlin.common import constraints +from senlin.common import consts from senlin.common import exception as exc from senlin.common.i18n import _ from senlin.common import schema @@ -26,6 +27,12 @@ from senlin.profiles import base class ServerProfile(base.Profile): """Profile for an OpenStack Nova server.""" + VERSIONS = { + '1.0': [ + {'status': consts.SUPPORTED, 'since': '2016.04'} + ] + } + KEYS = ( CONTEXT, ADMIN_PASS, AUTO_DISK_CONFIG, AVAILABILITY_ZONE, BLOCK_DEVICE_MAPPING_V2,