diff --git a/heat/engine/worker.py b/heat/engine/worker.py index e92b4bf196..5d851a747f 100644 --- a/heat/engine/worker.py +++ b/heat/engine/worker.py @@ -269,7 +269,13 @@ def construct_input_data(rsrc): six.itervalues(rsrc.stack.resources), rsrc.stack.outputs, rsrc.name) - resolved_attributes = {attr: rsrc.FnGetAtt(attr) for attr in attributes} + resolved_attributes = {} + for attr in attributes: + try: + resolved_attributes[attr] = rsrc.FnGetAtt(attr) + except exception.InvalidTemplateAttribute as ita: + LOG.info(six.text_type(ita)) + input_data = {'id': rsrc.id, 'name': rsrc.name, 'physical_resource_id': rsrc.resource_id, diff --git a/heat/tests/engine/test_engine_worker.py b/heat/tests/engine/test_engine_worker.py index e67e875b5f..ae8287dbc7 100644 --- a/heat/tests/engine/test_engine_worker.py +++ b/heat/tests/engine/test_engine_worker.py @@ -442,7 +442,7 @@ class MiscMethodsTest(common.HeatTestCase): self.stack.converge_stack(self.stack.t) self.resource = self.stack['A'] - def test_construct_input_data(self): + def test_construct_input_data_ok(self): expected_input_data = {'attrs': {'value': None}, 'id': mock.ANY, 'physical_resource_id': None, @@ -450,6 +450,17 @@ class MiscMethodsTest(common.HeatTestCase): actual_input_data = worker.construct_input_data(self.resource) self.assertEqual(expected_input_data, actual_input_data) + def test_construct_input_data_exception(self): + expected_input_data = {'attrs': {}, + 'id': mock.ANY, + 'physical_resource_id': None, + 'name': 'A'} + self.resource.FnGetAtt = mock.Mock( + side_effect=exception.InvalidTemplateAttribute(resource='A', + key='value')) + actual_input_data = worker.construct_input_data(self.resource) + self.assertEqual(expected_input_data, actual_input_data) + @mock.patch.object(sync_point, 'sync') def test_check_stack_complete_root(self, mock_sync): worker.check_stack_complete(