diff --git a/heat/engine/resources/resource_group.py b/heat/engine/resources/resource_group.py index dd8944116..70df98d50 100644 --- a/heat/engine/resources/resource_group.py +++ b/heat/engine/resources/resource_group.py @@ -145,6 +145,8 @@ class ResourceGroup(stack_resource.StackResource): def _assemble_nested(self, count, include_all=False): child_template = copy.deepcopy(template_template) resource_def = self.properties[self.RESOURCE_DEF] + if resource_def[self.RESOURCE_DEF_PROPERTIES] is None: + resource_def[self.RESOURCE_DEF_PROPERTIES] = {} if not include_all: resource_def_props = resource_def[self.RESOURCE_DEF_PROPERTIES] clean = dict((k, v) for k, v in resource_def_props.items() if v) diff --git a/heat/tests/test_resource_group.py b/heat/tests/test_resource_group.py index 3d8cfbb5b..2eb8b48b0 100644 --- a/heat/tests/test_resource_group.py +++ b/heat/tests/test_resource_group.py @@ -134,6 +134,14 @@ class ResourceGroupTest(common.HeatTestCase): expect['resources']["0"]['properties'] = {"Foo": None} self.assertEqual(expect, resg._assemble_nested(1, include_all=True)) + def test_assemble_no_properties(self): + templ = copy.deepcopy(template) + res_def = templ["resources"]["group1"]["properties"]['resource_def'] + del res_def['properties'] + stack = utils.parse_stack(templ) + resg = stack.resources['group1'] + self.assertIsNone(resg.validate()) + def test_invalid_res_type(self): """Test that error raised for unknown resource type.""" tmp = copy.deepcopy(template)