Rename OS::Heat::SoftwareDeployments
Rename the SoftwareDeployments resource to SoftwareDeploymentGroup to avoid awkward situations when talking about the plural form of the SoftwareDeployment resource. This has been agreed at the Vancouver summit. The existing 'SoftwareDeployments' resource is kept for backwards compatibility, but with a deprecated status and corresponding deprecation message. Change-Id: Iae38b4afcb924ba626eccadfd68712e708be2bff Partial-Bug: #1458008
This commit is contained in:
parent
022a863284
commit
94c2c5fc48
|
@ -576,9 +576,9 @@ class SoftwareDeployment(signal_responder.SignalResponder):
|
|||
"deployments on it.") % server)
|
||||
|
||||
|
||||
class SoftwareDeployments(resource_group.ResourceGroup):
|
||||
class SoftwareDeploymentGroup(resource_group.ResourceGroup):
|
||||
|
||||
support_status = support.SupportStatus(version='2014.2')
|
||||
support_status = support.SupportStatus(version='2015.2')
|
||||
|
||||
PROPERTIES = (
|
||||
SERVERS,
|
||||
|
@ -657,7 +657,7 @@ class SoftwareDeployments(resource_group.ResourceGroup):
|
|||
}
|
||||
|
||||
def FnGetAtt(self, key, *path):
|
||||
rg = super(SoftwareDeployments, self)
|
||||
rg = super(SoftwareDeploymentGroup, self)
|
||||
if key == self.STDOUTS:
|
||||
return rg.FnGetAtt(
|
||||
rg.ATTR_ATTRIBUTES, SoftwareDeployment.STDOUT)
|
||||
|
@ -669,8 +669,19 @@ class SoftwareDeployments(resource_group.ResourceGroup):
|
|||
rg.ATTR_ATTRIBUTES, SoftwareDeployment.STATUS_CODE)
|
||||
|
||||
|
||||
class SoftwareDeployments(SoftwareDeploymentGroup):
|
||||
|
||||
deprecation_msg = _('This resource is deprecated and use is discouraged. '
|
||||
'Please use resource OS::Heat:SoftwareDeploymentGroup '
|
||||
'instead.')
|
||||
support_status = support.SupportStatus(status=support.DEPRECATED,
|
||||
message=deprecation_msg,
|
||||
version='2014.2')
|
||||
|
||||
|
||||
def resource_mapping():
|
||||
return {
|
||||
'OS::Heat::SoftwareDeployment': SoftwareDeployment,
|
||||
'OS::Heat::SoftwareDeploymentGroup': SoftwareDeploymentGroup,
|
||||
'OS::Heat::SoftwareDeployments': SoftwareDeployments,
|
||||
}
|
||||
|
|
|
@ -179,7 +179,7 @@ class StructuredDeployment(sd.SoftwareDeployment):
|
|||
return snippet
|
||||
|
||||
|
||||
class StructuredDeployments(sd.SoftwareDeployments):
|
||||
class StructuredDeployments(sd.SoftwareDeploymentGroup):
|
||||
|
||||
PROPERTIES = (
|
||||
SERVERS,
|
||||
|
@ -191,17 +191,17 @@ class StructuredDeployments(sd.SoftwareDeployments):
|
|||
INPUT_KEY,
|
||||
INPUT_VALUES_VALIDATE,
|
||||
) = (
|
||||
sd.SoftwareDeployments.SERVERS,
|
||||
sd.SoftwareDeployments.CONFIG,
|
||||
sd.SoftwareDeployments.INPUT_VALUES,
|
||||
sd.SoftwareDeployments.DEPLOY_ACTIONS,
|
||||
sd.SoftwareDeployments.NAME,
|
||||
sd.SoftwareDeployments.SIGNAL_TRANSPORT,
|
||||
sd.SoftwareDeploymentGroup.SERVERS,
|
||||
sd.SoftwareDeploymentGroup.CONFIG,
|
||||
sd.SoftwareDeploymentGroup.INPUT_VALUES,
|
||||
sd.SoftwareDeploymentGroup.DEPLOY_ACTIONS,
|
||||
sd.SoftwareDeploymentGroup.NAME,
|
||||
sd.SoftwareDeploymentGroup.SIGNAL_TRANSPORT,
|
||||
StructuredDeployment.INPUT_KEY,
|
||||
StructuredDeployment.INPUT_VALUES_VALIDATE
|
||||
)
|
||||
|
||||
_sds_ps = sd.SoftwareDeployments.properties_schema
|
||||
_sds_ps = sd.SoftwareDeploymentGroup.properties_schema
|
||||
|
||||
properties_schema = {
|
||||
SERVERS: _sds_ps[SERVERS],
|
||||
|
|
|
@ -2587,7 +2587,9 @@ class StackServiceTest(common.HeatTestCase):
|
|||
resources = self.eng.list_resource_types(self.ctx, "DEPRECATED")
|
||||
self.assertEqual(set(['OS::Neutron::RouterGateway',
|
||||
'OS::Heat::CWLiteAlarm',
|
||||
'OS::Heat::HARestarter']), set(resources))
|
||||
'OS::Heat::HARestarter',
|
||||
'OS::Heat::SoftwareDeployments']),
|
||||
set(resources))
|
||||
|
||||
def test_list_resource_types_supported(self):
|
||||
resources = self.eng.list_resource_types(self.ctx, "SUPPORTED")
|
||||
|
|
|
@ -1026,13 +1026,13 @@ class SoftwareDeploymentTest(common.HeatTestCase):
|
|||
self.assertIsNotNone(self.deployment._handle_action(action))
|
||||
|
||||
|
||||
class SoftwareDeploymentsTest(common.HeatTestCase):
|
||||
class SoftwareDeploymentGroupTest(common.HeatTestCase):
|
||||
|
||||
template = {
|
||||
'heat_template_version': '2013-05-23',
|
||||
'resources': {
|
||||
'deploy_mysql': {
|
||||
'type': 'OS::Heat::SoftwareDeployments',
|
||||
'type': 'OS::Heat::SoftwareDeploymentGroup',
|
||||
'properties': {
|
||||
'config': 'config_uuid',
|
||||
'servers': {'server1': 'uuid1', 'server2': 'uuid2'},
|
||||
|
@ -1050,7 +1050,7 @@ class SoftwareDeploymentsTest(common.HeatTestCase):
|
|||
def test_build_resource_definition(self):
|
||||
stack = utils.parse_stack(self.template)
|
||||
snip = stack.t.resource_definitions(stack)['deploy_mysql']
|
||||
resg = sd.SoftwareDeployments('test', snip, stack)
|
||||
resg = sd.SoftwareDeploymentGroup('test', snip, stack)
|
||||
expect = {
|
||||
'type': 'OS::Heat::SoftwareDeployment',
|
||||
'properties': {
|
||||
|
@ -1069,7 +1069,7 @@ class SoftwareDeploymentsTest(common.HeatTestCase):
|
|||
def test_resource_names(self):
|
||||
stack = utils.parse_stack(self.template)
|
||||
snip = stack.t.resource_definitions(stack)['deploy_mysql']
|
||||
resg = sd.SoftwareDeployments('test', snip, stack)
|
||||
resg = sd.SoftwareDeploymentGroup('test', snip, stack)
|
||||
self.assertEqual(
|
||||
set(('server1', 'server2')),
|
||||
set(resg._resource_names())
|
||||
|
@ -1087,7 +1087,7 @@ class SoftwareDeploymentsTest(common.HeatTestCase):
|
|||
"""
|
||||
stack = utils.parse_stack(self.template)
|
||||
snip = stack.t.resource_definitions(stack)['deploy_mysql']
|
||||
resg = sd.SoftwareDeployments('test', snip, stack)
|
||||
resg = sd.SoftwareDeploymentGroup('test', snip, stack)
|
||||
templ = {
|
||||
"heat_template_version": "2013-05-23",
|
||||
"resources": {
|
||||
|
@ -1121,7 +1121,7 @@ class SoftwareDeploymentsTest(common.HeatTestCase):
|
|||
def test_attributes(self):
|
||||
stack = utils.parse_stack(self.template)
|
||||
snip = stack.t.resource_definitions(stack)['deploy_mysql']
|
||||
resg = sd.SoftwareDeployments('test', snip, stack)
|
||||
resg = sd.SoftwareDeploymentGroup('test', snip, stack)
|
||||
nested = self.patchobject(resg, 'nested')
|
||||
server1 = mock.MagicMock()
|
||||
server2 = mock.MagicMock()
|
||||
|
@ -1160,5 +1160,5 @@ class SoftwareDeploymentsTest(common.HeatTestCase):
|
|||
def test_validate(self):
|
||||
stack = utils.parse_stack(self.template)
|
||||
snip = stack.t.resource_definitions(stack)['deploy_mysql']
|
||||
resg = sd.SoftwareDeployments('deploy_mysql', snip, stack)
|
||||
resg = sd.SoftwareDeploymentGroup('deploy_mysql', snip, stack)
|
||||
self.assertIsNone(resg.validate())
|
||||
|
|
Loading…
Reference in New Issue