diff --git a/heat/engine/check_resource.py b/heat/engine/check_resource.py index d0b839b404..5b8ac4024b 100644 --- a/heat/engine/check_resource.py +++ b/heat/engine/check_resource.py @@ -206,7 +206,7 @@ class CheckResource(object): stack.adopt_stack_data) check_stack_complete(cnxt, stack, current_traversal, - resource_id, deps, is_update) + graph_key[0], deps, graph_key[1]) except exception.EntityNotFound as e: if e.entity == "Sync Point": # Reload the stack to determine the current traversal, and diff --git a/heat/tests/engine/test_check_resource.py b/heat/tests/engine/test_check_resource.py index 2c37fbea46..50b475f9aa 100644 --- a/heat/tests/engine/test_check_resource.py +++ b/heat/tests/engine/test_check_resource.py @@ -336,6 +336,26 @@ class CheckWorkflowUpdateTest(common.HeatTestCase): mock_rcr.assert_called_once_with(self.ctx, self.is_update, self.resource.id, updated_stack) + def test_check_stack_complete_is_invoked_for_replaced_resource( + self, mock_cru, mock_crc, mock_pcr, mock_csc, mock_cid): + resC = self.stack['C'] + # lets say C is update-replaced + is_update = True + replacementC_id = resC.make_replacement(self.stack.t.id) + replacementC, stack, _ = resource.Resource.load(self.ctx, + replacementC_id, + is_update, {}) + self.cr._initiate_propagate_resource(self.ctx, replacementC_id, + self.stack.current_traversal, + is_update, replacementC, + self.stack) + # check_stack_complete should be called with resC.id not + # replacementC.id + mock_csc.assert_called_once_with(self.ctx, self.stack, + self.stack.current_traversal, + resC.id, mock.ANY, + is_update) + @mock.patch.object(sync_point, 'sync') def test_retrigger_check_resource(self, mock_sync, mock_cru, mock_crc, mock_pcr, mock_csc, mock_cid):