Add version to support_status where it omitted

This improve doc notes about deprecated objects
and adds option 'version' to all objects with
support_status parameter.

blueprint deprecating-improvements

Change-Id: I82f9f4514142a3a66c872722b265fee365eb5de2
This commit is contained in:
Peter Razumovsky 2015-03-13 17:18:48 +03:00
parent dd92a7b2bb
commit c31166a11c
16 changed files with 84 additions and 53 deletions

View File

@ -54,9 +54,9 @@ class ZaqarQueue(resource.Resource):
cache_mode=attributes.Schema.CACHE_NONE,
support_status=support.SupportStatus(
status=support.DEPRECATED,
message=_("Deprecated in kilo. "
"Use get_resource|Ref command instead. "
"For example: { get_resource : <resource_name> }")
message=_("Use get_resource|Ref command instead. "
"For example: { get_resource : <resource_name> }"),
version='2015.1'
)
),
HREF: attributes.Schema(

View File

@ -48,8 +48,9 @@ class CloudNetwork(resource.Resource):
"""
support_status = support.SupportStatus(
support.DEPRECATED,
_('Use OS::Neutron::Net instead.'),
status=support.DEPRECATED,
message=_('Use OS::Neutron::Net instead.'),
version='2015.1'
)
PROPERTIES = (

View File

@ -106,8 +106,9 @@ class CinderVolume(aws_vol.Volume):
properties.Schema.STRING,
_('The ID of the image to create the volume from.'),
support_status=support.SupportStatus(
support.DEPRECATED,
_('Use property %s.') % IMAGE)
status=support.DEPRECATED,
message=_('Use property %s.') % IMAGE,
version='2014.1')
),
IMAGE: properties.Schema(
properties.Schema.STRING,

View File

@ -143,7 +143,8 @@ class CloudWatchAlarm(resource.Resource):
support_status = support.SupportStatus(
status=support.DEPRECATED,
message=_('OS::Heat::CWLiteAlarm is deprecated, '
'use OS::Ceilometer::Alarm instead.'))
'use OS::Ceilometer::Alarm instead.'),
version='2014.2')
def handle_create(self):
wr = watchrule.WatchRule(context=self.context,

View File

@ -29,12 +29,13 @@ class Restarter(signal_responder.SignalResponder):
support_status = support.SupportStatus(
support.DEPRECATED,
_('The HARestarter resource type is unsupported and will be removed '
_('The HARestarter resource type is deprecated and will be removed '
'in a future release of Heat, once it has support for auto-healing '
'any type of resource. Note that HARestarter does *not* actually '
'restart servers - it deletes and then recreates them. It also does '
'the same to all dependent resources, and may therefore exhibit '
'unexpected and undesirable behaviour. Avoid.')
'unexpected and undesirable behaviour. Avoid.'),
version='2015.1'
)
PROPERTIES = (

View File

@ -79,8 +79,9 @@ class RandomString(resource.Resource):
'octdigits']),
],
support_status=support.SupportStatus(
support.DEPRECATED,
_('Use property %s.') % CHARACTER_CLASSES
status=support.DEPRECATED,
message=_('Use property %s.') % CHARACTER_CLASSES,
version='2014.2'
)
),
CHARACTER_CLASSES: properties.Schema(

View File

@ -44,8 +44,9 @@ class FloatingIP(neutron.NeutronResource):
FLOATING_NETWORK_ID: properties.Schema(
properties.Schema.STRING,
support_status=support.SupportStatus(
support.DEPRECATED,
_('Use property %s.') % FLOATING_NETWORK),
status=support.DEPRECATED,
message=_('Use property %s.') % FLOATING_NETWORK,
version='2014.2'),
required=False,
constraints=[
constraints.CustomConstraint('neutron.network')

View File

@ -213,8 +213,9 @@ class Pool(neutron.NeutronResource):
SUBNET_ID: properties.Schema(
properties.Schema.STRING,
support_status=support.SupportStatus(
support.DEPRECATED,
_('Use property %s.') % SUBNET),
status=support.DEPRECATED,
message=_('Use property %s.') % SUBNET,
version='2014.2'),
required=False,
constraints=[
constraints.CustomConstraint('neutron.subnet')

View File

@ -95,8 +95,9 @@ class NetworkGateway(neutron.NeutronResource):
NETWORK_ID: properties.Schema(
properties.Schema.STRING,
support_status=support.SupportStatus(
support.DEPRECATED,
_('Use property %s.') % NETWORK),
status=support.DEPRECATED,
message=_('Use property %s.') % NETWORK,
version='2014.2'),
required=False,
constraints=[
constraints.CustomConstraint('neutron.network')

View File

@ -66,8 +66,9 @@ class Port(neutron.NeutronResource):
NETWORK_ID: properties.Schema(
properties.Schema.STRING,
support_status=support.SupportStatus(
support.DEPRECATED,
_('Use property %s.') % NETWORK),
status=support.DEPRECATED,
message=_('Use property %s.') % NETWORK,
version='2014.2'),
constraints=[
constraints.CustomConstraint('neutron.network')
],
@ -112,8 +113,9 @@ class Port(neutron.NeutronResource):
FIXED_IP_SUBNET_ID: properties.Schema(
properties.Schema.STRING,
support_status=support.SupportStatus(
support.DEPRECATED,
_('Use property %s.') % FIXED_IP_SUBNET),
status=support.DEPRECATED,
message=_('Use property %s.') % FIXED_IP_SUBNET,
version='2014.2 '),
constraints=[
constraints.CustomConstraint('neutron.subnet')
]

View File

@ -90,8 +90,9 @@ class Router(neutron.NeutronResource):
'users only.'),
update_allowed=True,
support_status=support.SupportStatus(
support.DEPRECATED,
_('Deprecated in Kilo. Use property %s.') % L3_AGENT_IDS),
status=support.DEPRECATED,
version='2015.1',
message=_('Use property %s.') % L3_AGENT_IDS),
),
L3_AGENT_IDS: properties.Schema(
properties.Schema.LIST,
@ -272,8 +273,9 @@ class RouterInterface(neutron.NeutronResource):
properties.Schema.STRING,
_('ID of the router.'),
support_status=support.SupportStatus(
support.DEPRECATED,
_('Use property %s.') % ROUTER),
status=support.DEPRECATED,
message=_('Use property %s.') % ROUTER,
version='2015.1'),
constraints=[
constraints.CustomConstraint('neutron.router')
],
@ -281,8 +283,9 @@ class RouterInterface(neutron.NeutronResource):
SUBNET_ID: properties.Schema(
properties.Schema.STRING,
support_status=support.SupportStatus(
support.DEPRECATED,
_('Use property %s.') % SUBNET),
status=support.DEPRECATED,
message=_('Use property %s.') % SUBNET,
version='2014.2'),
constraints=[
constraints.CustomConstraint('neutron.subnet')
]
@ -299,9 +302,9 @@ class RouterInterface(neutron.NeutronResource):
properties.Schema.STRING,
_('The port id, either subnet or port_id should be specified.'),
support_status=support.SupportStatus(
support.DEPRECATED,
_('Deprecated in Kilo. '
'Use property %s.') % PORT),
status=support.DEPRECATED,
message=_('Use property %s.') % PORT,
version='2015.1'),
constraints=[
constraints.CustomConstraint('neutron.port')
]
@ -383,10 +386,10 @@ class RouterInterface(neutron.NeutronResource):
class RouterGateway(neutron.NeutronResource):
support_status = support.SupportStatus(
support.DEPRECATED,
_('RouterGateway resource is deprecated and should not be used. '
'Instead use the `external_gateway_info` property in the router '
'resource to set up the gateway.')
status=support.DEPRECATED,
message=_('Use the `external_gateway_info` property in '
'the router resource to set up the gateway.'),
version='2014.1'
)
PROPERTIES = (
@ -407,8 +410,9 @@ class RouterGateway(neutron.NeutronResource):
NETWORK_ID: properties.Schema(
properties.Schema.STRING,
support_status=support.SupportStatus(
support.DEPRECATED,
_('Use property %s.') % NETWORK),
status=support.DEPRECATED,
message=_('Use property %s.') % NETWORK,
version='2014.2'),
required=False,
constraints=[
constraints.CustomConstraint('neutron.network')

View File

@ -64,8 +64,9 @@ class Subnet(neutron.NeutronResource):
NETWORK_ID: properties.Schema(
properties.Schema.STRING,
support_status=support.SupportStatus(
support.DEPRECATED,
_('Use property %s.') % NETWORK),
status=support.DEPRECATED,
message=_('Use property %s.') % NETWORK,
version='2014.2'),
required=False,
constraints=[
constraints.CustomConstraint('neutron.network')
@ -78,6 +79,7 @@ class Subnet(neutron.NeutronResource):
constraints=[
constraints.CustomConstraint('neutron.network')
],
support_status=support.SupportStatus(version='2014.2')
),
CIDR: properties.Schema(
properties.Schema.STRING,

View File

@ -60,8 +60,9 @@ class VPNService(neutron.NeutronResource):
SUBNET_ID: properties.Schema(
properties.Schema.STRING,
support_status=support.SupportStatus(
support.DEPRECATED,
_('Use property %s.') % SUBNET),
status=support.DEPRECATED,
message=_('Use property %s.') % SUBNET,
version='2014.2'),
required=False,
constraints=[
constraints.CustomConstraint('neutron.subnet')
@ -81,8 +82,9 @@ class VPNService(neutron.NeutronResource):
_('Unique identifier for the router to which the vpn service '
'will be inserted.'),
support_status=support.SupportStatus(
support.DEPRECATED,
_('Use property %s') % ROUTER),
status=support.DEPRECATED,
message=_('Use property %s') % ROUTER,
version='2015.1'),
constraints=[
constraints.CustomConstraint('neutron.router')
]
@ -90,6 +92,7 @@ class VPNService(neutron.NeutronResource):
ROUTER: properties.Schema(
properties.Schema.STRING,
_('The router to which the vpn service will be inserted.'),
support_status=support.SupportStatus(version='2015.1'),
constraints=[
constraints.CustomConstraint('neutron.router')
]

View File

@ -291,11 +291,12 @@ class Server(stack_user.StackUser):
ADMIN_USER: properties.Schema(
properties.Schema.STRING,
_('Name of the administrative user to use on the server. '
'This property will be removed from Juno in favor of the '
'default cloud-init user set up for each image (e.g. "ubuntu" '
'for Ubuntu 12.04+, "fedora" for Fedora 19+ and "cloud-user" '
'for CentOS/RHEL 6.5).'),
support_status=support.SupportStatus(status=support.DEPRECATED)
'The default cloud-init user set up for each image '
'(e.g. "ubuntu" for Ubuntu 12.04+, "fedora" for Fedora 19+ '
'and "cloud-user" for CentOS/RHEL 6.5).'),
support_status=support.SupportStatus(
status=support.DEPRECATED,
version='2014.1')
),
AVAILABILITY_ZONE: properties.Schema(
properties.Schema.STRING,
@ -319,8 +320,9 @@ class Server(stack_user.StackUser):
properties.Schema.STRING,
_('ID of network to create a port on.'),
support_status=support.SupportStatus(
support.DEPRECATED,
_('Use property %s.') % NETWORK_ID),
status=support.DEPRECATED,
message=_('Use property %s.') % NETWORK_ID,
version='2014.1'),
constraints=[
constraints.CustomConstraint('neutron.network')
]
@ -448,6 +450,7 @@ class Server(stack_user.StackUser):
'addresses from more than one network.'),
support_status=support.SupportStatus(
status=support.DEPRECATED,
version='2014.2',
message=_('Use the networks attribute instead of '
'first_address. For example: "{get_attr: '
'[<server name>, networks, <network name>, 0]}"')

View File

@ -80,9 +80,9 @@ class SaharaCluster(resource.Resource):
properties.Schema.STRING,
_('Name or UUID of the image used to boot Hadoop nodes.'),
support_status=support.SupportStatus(
support.DEPRECATED,
_('Property was deprecated in Kilo release. '
'Use property %s.') % IMAGE_ID),
status=support.DEPRECATED,
message=_('Use property %s.') % IMAGE_ID,
version='2015.1'),
constraints=[
constraints.CustomConstraint('glance.image')
],
@ -93,6 +93,7 @@ class SaharaCluster(resource.Resource):
constraints=[
constraints.CustomConstraint('sahara.image'),
],
support_status=support.SupportStatus(version='2015.1')
),
MANAGEMENT_NETWORK: properties.Schema(
properties.Schema.STRING,

View File

@ -21,6 +21,14 @@ SUPPORT_STATUSES = (UNKNOWN, SUPPORTED, PROTOTYPE, DEPRECATED,
class SupportStatus(object):
def __init__(self, status=SUPPORTED, message=None, version=None):
"""Use SupportStatus for current status of object.
:param status: current status of object.
:param version: version of OpenStack, from which current status is
valid. It may be None, but need to be defined for correct
doc generating.
:param message: specific status message for object.
"""
if status in SUPPORT_STATUSES:
self.status = status
self.message = message