Rename OS::Heat::StructuredDeployments

Rename the StructuredDeployments resource to StructuredDeploymentGroup
to avoid awkward situations when talking about the plural form of the
StructuredDeployment resource. This has been agreed at the Vancouver
summit.

The existing 'StructuredDeployments' resource is kept for backwards
compatibility, but with a deprecated status and corresponding
deprecation message.

Closes-Bug: #1458008

Change-Id: I5d274acf17f222c493d10ded50f87e05a075b424
This commit is contained in:
Thomas Spatzier 2015-05-26 14:59:33 +02:00
parent 94c2c5fc48
commit 1339f0a0b1
3 changed files with 22 additions and 8 deletions

View File

@ -179,7 +179,7 @@ class StructuredDeployment(sd.SoftwareDeployment):
return snippet
class StructuredDeployments(sd.SoftwareDeploymentGroup):
class StructuredDeploymentGroup(sd.SoftwareDeploymentGroup):
PROPERTIES = (
SERVERS,
@ -231,9 +231,20 @@ class StructuredDeployments(sd.SoftwareDeploymentGroup):
}
class StructuredDeployments(StructuredDeploymentGroup):
deprecation_msg = _('This resource is deprecated and use is discouraged. '
'Please use resource '
'OS::Heat:StructuredDeploymentGroup instead.')
support_status = support.SupportStatus(status=support.DEPRECATED,
message=deprecation_msg,
version='2014.2')
def resource_mapping():
return {
'OS::Heat::StructuredConfig': StructuredConfig,
'OS::Heat::StructuredDeployment': StructuredDeployment,
'OS::Heat::StructuredDeploymentGroup': StructuredDeploymentGroup,
'OS::Heat::StructuredDeployments': StructuredDeployments,
}

View File

@ -2588,7 +2588,8 @@ class StackServiceTest(common.HeatTestCase):
self.assertEqual(set(['OS::Neutron::RouterGateway',
'OS::Heat::CWLiteAlarm',
'OS::Heat::HARestarter',
'OS::Heat::SoftwareDeployments']),
'OS::Heat::SoftwareDeployments',
'OS::Heat::StructuredDeployments']),
set(resources))
def test_list_resource_types_supported(self):

View File

@ -134,11 +134,13 @@ class StructuredConfigTestJSON(common.HeatTestCase):
def test_resource_mapping(self):
mapping = sc.resource_mapping()
self.assertEqual(3, len(mapping))
self.assertEqual(4, len(mapping))
self.assertEqual(sc.StructuredConfig,
mapping['OS::Heat::StructuredConfig'])
self.assertEqual(sc.StructuredDeployment,
mapping['OS::Heat::StructuredDeployment'])
self.assertEqual(sc.StructuredDeploymentGroup,
mapping['OS::Heat::StructuredDeploymentGroup'])
self.assertEqual(sc.StructuredDeployments,
mapping['OS::Heat::StructuredDeployments'])
self.assertIsInstance(self.config, sc.StructuredConfig)
@ -261,13 +263,13 @@ class StructuredDeploymentParseTest(common.HeatTestCase):
parse(self.inputs, self.input_key, self.config))
class StructuredDeploymentsTest(common.HeatTestCase):
class StructuredDeploymentGroupTest(common.HeatTestCase):
template = {
'heat_template_version': '2013-05-23',
'resources': {
'deploy_mysql': {
'type': 'OS::Heat::StructuredDeployments',
'type': 'OS::Heat::StructuredDeploymentGroup',
'properties': {
'config': 'config_uuid',
'servers': {'server1': 'uuid1', 'server2': 'uuid2'},
@ -284,7 +286,7 @@ class StructuredDeploymentsTest(common.HeatTestCase):
def test_build_resource_definition(self):
stack = utils.parse_stack(self.template)
snip = stack.t.resource_definitions(stack)['deploy_mysql']
resg = sc.StructuredDeployments('test', snip, stack)
resg = sc.StructuredDeploymentGroup('test', snip, stack)
expect = {
'type': 'OS::Heat::StructuredDeployment',
'properties': {
@ -305,7 +307,7 @@ class StructuredDeploymentsTest(common.HeatTestCase):
def test_resource_names(self):
stack = utils.parse_stack(self.template)
snip = stack.t.resource_definitions(stack)['deploy_mysql']
resg = sc.StructuredDeployments('test', snip, stack)
resg = sc.StructuredDeploymentGroup('test', snip, stack)
self.assertEqual(
set(('server1', 'server2')),
set(resg._resource_names())
@ -323,7 +325,7 @@ class StructuredDeploymentsTest(common.HeatTestCase):
"""
stack = utils.parse_stack(self.template)
snip = stack.t.resource_definitions(stack)['deploy_mysql']
resg = sc.StructuredDeployments('test', snip, stack)
resg = sc.StructuredDeploymentGroup('test', snip, stack)
templ = {
"heat_template_version": "2013-05-23",
"resources": {