diff --git a/heat/engine/stack.py b/heat/engine/stack.py index 5ad28aeac3..caecf889ae 100644 --- a/heat/engine/stack.py +++ b/heat/engine/stack.py @@ -386,7 +386,10 @@ class Stack(collections.Mapping): """Return the dependency graph for a list of resources.""" deps = dependencies.Dependencies() for res in resources: - res.add_dependencies(deps) + try: + res.add_dependencies(deps) + except ValueError: + pass return deps diff --git a/heat/tests/test_resource.py b/heat/tests/test_resource.py index 5b1030d4ad..972cacee72 100644 --- a/heat/tests/test_resource.py +++ b/heat/tests/test_resource.py @@ -2343,6 +2343,22 @@ class ResourceDependenciesTest(common.HeatTestCase): self.assertIn(res, graph) + def test_hot_add_dep_error(self): + tmpl = template.Template({ + 'heat_template_version': '2013-05-23', + 'resources': { + 'foo': {'type': 'GenericResourceType'}, + 'bar': {'type': 'ResourceWithPropsType'} + } + }) + stack = parser.Stack(utils.dummy_context(), 'test', tmpl) + res = stack['bar'] + self.patchobject(res, 'add_dependencies', + side_effect=ValueError) + graph = stack.dependencies.graph() + self.assertNotIn(res, graph) + self.assertIn(stack['foo'], graph) + def test_ref(self): tmpl = template.Template({ 'HeatTemplateFormatVersion': '2012-12-12',