Merge "Rename OS::Heat::SoftwareDeployments"
This commit is contained in:
@@ -576,9 +576,9 @@ class SoftwareDeployment(signal_responder.SignalResponder):
|
|||||||
"deployments on it.") % server)
|
"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 = (
|
PROPERTIES = (
|
||||||
SERVERS,
|
SERVERS,
|
||||||
@@ -657,7 +657,7 @@ class SoftwareDeployments(resource_group.ResourceGroup):
|
|||||||
}
|
}
|
||||||
|
|
||||||
def FnGetAtt(self, key, *path):
|
def FnGetAtt(self, key, *path):
|
||||||
rg = super(SoftwareDeployments, self)
|
rg = super(SoftwareDeploymentGroup, self)
|
||||||
if key == self.STDOUTS:
|
if key == self.STDOUTS:
|
||||||
return rg.FnGetAtt(
|
return rg.FnGetAtt(
|
||||||
rg.ATTR_ATTRIBUTES, SoftwareDeployment.STDOUT)
|
rg.ATTR_ATTRIBUTES, SoftwareDeployment.STDOUT)
|
||||||
@@ -669,8 +669,19 @@ class SoftwareDeployments(resource_group.ResourceGroup):
|
|||||||
rg.ATTR_ATTRIBUTES, SoftwareDeployment.STATUS_CODE)
|
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():
|
def resource_mapping():
|
||||||
return {
|
return {
|
||||||
'OS::Heat::SoftwareDeployment': SoftwareDeployment,
|
'OS::Heat::SoftwareDeployment': SoftwareDeployment,
|
||||||
|
'OS::Heat::SoftwareDeploymentGroup': SoftwareDeploymentGroup,
|
||||||
'OS::Heat::SoftwareDeployments': SoftwareDeployments,
|
'OS::Heat::SoftwareDeployments': SoftwareDeployments,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ class StructuredDeployment(sd.SoftwareDeployment):
|
|||||||
return snippet
|
return snippet
|
||||||
|
|
||||||
|
|
||||||
class StructuredDeployments(sd.SoftwareDeployments):
|
class StructuredDeployments(sd.SoftwareDeploymentGroup):
|
||||||
|
|
||||||
PROPERTIES = (
|
PROPERTIES = (
|
||||||
SERVERS,
|
SERVERS,
|
||||||
@@ -191,17 +191,17 @@ class StructuredDeployments(sd.SoftwareDeployments):
|
|||||||
INPUT_KEY,
|
INPUT_KEY,
|
||||||
INPUT_VALUES_VALIDATE,
|
INPUT_VALUES_VALIDATE,
|
||||||
) = (
|
) = (
|
||||||
sd.SoftwareDeployments.SERVERS,
|
sd.SoftwareDeploymentGroup.SERVERS,
|
||||||
sd.SoftwareDeployments.CONFIG,
|
sd.SoftwareDeploymentGroup.CONFIG,
|
||||||
sd.SoftwareDeployments.INPUT_VALUES,
|
sd.SoftwareDeploymentGroup.INPUT_VALUES,
|
||||||
sd.SoftwareDeployments.DEPLOY_ACTIONS,
|
sd.SoftwareDeploymentGroup.DEPLOY_ACTIONS,
|
||||||
sd.SoftwareDeployments.NAME,
|
sd.SoftwareDeploymentGroup.NAME,
|
||||||
sd.SoftwareDeployments.SIGNAL_TRANSPORT,
|
sd.SoftwareDeploymentGroup.SIGNAL_TRANSPORT,
|
||||||
StructuredDeployment.INPUT_KEY,
|
StructuredDeployment.INPUT_KEY,
|
||||||
StructuredDeployment.INPUT_VALUES_VALIDATE
|
StructuredDeployment.INPUT_VALUES_VALIDATE
|
||||||
)
|
)
|
||||||
|
|
||||||
_sds_ps = sd.SoftwareDeployments.properties_schema
|
_sds_ps = sd.SoftwareDeploymentGroup.properties_schema
|
||||||
|
|
||||||
properties_schema = {
|
properties_schema = {
|
||||||
SERVERS: _sds_ps[SERVERS],
|
SERVERS: _sds_ps[SERVERS],
|
||||||
|
|||||||
@@ -2587,7 +2587,9 @@ class StackServiceTest(common.HeatTestCase):
|
|||||||
resources = self.eng.list_resource_types(self.ctx, "DEPRECATED")
|
resources = self.eng.list_resource_types(self.ctx, "DEPRECATED")
|
||||||
self.assertEqual(set(['OS::Neutron::RouterGateway',
|
self.assertEqual(set(['OS::Neutron::RouterGateway',
|
||||||
'OS::Heat::CWLiteAlarm',
|
'OS::Heat::CWLiteAlarm',
|
||||||
'OS::Heat::HARestarter']), set(resources))
|
'OS::Heat::HARestarter',
|
||||||
|
'OS::Heat::SoftwareDeployments']),
|
||||||
|
set(resources))
|
||||||
|
|
||||||
def test_list_resource_types_supported(self):
|
def test_list_resource_types_supported(self):
|
||||||
resources = self.eng.list_resource_types(self.ctx, "SUPPORTED")
|
resources = self.eng.list_resource_types(self.ctx, "SUPPORTED")
|
||||||
|
|||||||
@@ -1026,13 +1026,13 @@ class SoftwareDeploymentTest(common.HeatTestCase):
|
|||||||
self.assertIsNotNone(self.deployment._handle_action(action))
|
self.assertIsNotNone(self.deployment._handle_action(action))
|
||||||
|
|
||||||
|
|
||||||
class SoftwareDeploymentsTest(common.HeatTestCase):
|
class SoftwareDeploymentGroupTest(common.HeatTestCase):
|
||||||
|
|
||||||
template = {
|
template = {
|
||||||
'heat_template_version': '2013-05-23',
|
'heat_template_version': '2013-05-23',
|
||||||
'resources': {
|
'resources': {
|
||||||
'deploy_mysql': {
|
'deploy_mysql': {
|
||||||
'type': 'OS::Heat::SoftwareDeployments',
|
'type': 'OS::Heat::SoftwareDeploymentGroup',
|
||||||
'properties': {
|
'properties': {
|
||||||
'config': 'config_uuid',
|
'config': 'config_uuid',
|
||||||
'servers': {'server1': 'uuid1', 'server2': 'uuid2'},
|
'servers': {'server1': 'uuid1', 'server2': 'uuid2'},
|
||||||
@@ -1050,7 +1050,7 @@ class SoftwareDeploymentsTest(common.HeatTestCase):
|
|||||||
def test_build_resource_definition(self):
|
def test_build_resource_definition(self):
|
||||||
stack = utils.parse_stack(self.template)
|
stack = utils.parse_stack(self.template)
|
||||||
snip = stack.t.resource_definitions(stack)['deploy_mysql']
|
snip = stack.t.resource_definitions(stack)['deploy_mysql']
|
||||||
resg = sd.SoftwareDeployments('test', snip, stack)
|
resg = sd.SoftwareDeploymentGroup('test', snip, stack)
|
||||||
expect = {
|
expect = {
|
||||||
'type': 'OS::Heat::SoftwareDeployment',
|
'type': 'OS::Heat::SoftwareDeployment',
|
||||||
'properties': {
|
'properties': {
|
||||||
@@ -1069,7 +1069,7 @@ class SoftwareDeploymentsTest(common.HeatTestCase):
|
|||||||
def test_resource_names(self):
|
def test_resource_names(self):
|
||||||
stack = utils.parse_stack(self.template)
|
stack = utils.parse_stack(self.template)
|
||||||
snip = stack.t.resource_definitions(stack)['deploy_mysql']
|
snip = stack.t.resource_definitions(stack)['deploy_mysql']
|
||||||
resg = sd.SoftwareDeployments('test', snip, stack)
|
resg = sd.SoftwareDeploymentGroup('test', snip, stack)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
set(('server1', 'server2')),
|
set(('server1', 'server2')),
|
||||||
set(resg._resource_names())
|
set(resg._resource_names())
|
||||||
@@ -1087,7 +1087,7 @@ class SoftwareDeploymentsTest(common.HeatTestCase):
|
|||||||
"""
|
"""
|
||||||
stack = utils.parse_stack(self.template)
|
stack = utils.parse_stack(self.template)
|
||||||
snip = stack.t.resource_definitions(stack)['deploy_mysql']
|
snip = stack.t.resource_definitions(stack)['deploy_mysql']
|
||||||
resg = sd.SoftwareDeployments('test', snip, stack)
|
resg = sd.SoftwareDeploymentGroup('test', snip, stack)
|
||||||
templ = {
|
templ = {
|
||||||
"heat_template_version": "2013-05-23",
|
"heat_template_version": "2013-05-23",
|
||||||
"resources": {
|
"resources": {
|
||||||
@@ -1121,7 +1121,7 @@ class SoftwareDeploymentsTest(common.HeatTestCase):
|
|||||||
def test_attributes(self):
|
def test_attributes(self):
|
||||||
stack = utils.parse_stack(self.template)
|
stack = utils.parse_stack(self.template)
|
||||||
snip = stack.t.resource_definitions(stack)['deploy_mysql']
|
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')
|
nested = self.patchobject(resg, 'nested')
|
||||||
server1 = mock.MagicMock()
|
server1 = mock.MagicMock()
|
||||||
server2 = mock.MagicMock()
|
server2 = mock.MagicMock()
|
||||||
@@ -1160,5 +1160,5 @@ class SoftwareDeploymentsTest(common.HeatTestCase):
|
|||||||
def test_validate(self):
|
def test_validate(self):
|
||||||
stack = utils.parse_stack(self.template)
|
stack = utils.parse_stack(self.template)
|
||||||
snip = stack.t.resource_definitions(stack)['deploy_mysql']
|
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())
|
self.assertIsNone(resg.validate())
|
||||||
|
|||||||
Reference in New Issue
Block a user