Merge "Fix SoftwareDeployments validation"

This commit is contained in:
Jenkins 2014-12-21 15:27:28 +00:00 committed by Gerrit Code Review
commit 991c890650
2 changed files with 10 additions and 1 deletions

View File

@ -195,7 +195,10 @@ class ResourceGroup(stack_resource.StackResource):
# Only validate the resource definition (which may be a
# nested template) if count is non-zero, to enable folks
# to disable features via a zero count if they wish
if self.properties[self.COUNT]:
# Use self._resource_names() to determine if any resources will
# be created, not the COUNT property, because this doesn't exist
# in the SoftwareDeployments subclass properties schema.
if self._resource_names():
res_inst.validate()
def _name_blacklist(self):

View File

@ -943,3 +943,9 @@ class SoftwareDeploymentsTest(common.HeatTestCase):
mock.call('deploy_stderr'),
mock.call('deploy_status_code'),
])
def test_validate(self):
stack = utils.parse_stack(self.template)
snip = stack.t.resource_definitions(stack)['deploy_mysql']
resg = sd.SoftwareDeployments('test', snip, stack)
self.assertIsNone(resg.validate())