Convergence: fix input to check_stack_complete

The input to check stack complete should be the resource ID of the
resource that the current resource replaces instead of its own. Failing
to do so will result in stack being in in_progress state for ever.

Change-Id: I6f2856c82c8cc73f628976b7296ab0fb20af5ff3
Closes-Bug: #1614960
changes/81/357881/2
Anant Patil 6 years ago committed by Anant Patil
parent 50ee32f846
commit 78d56b1e0d
  1. 2
      heat/engine/check_resource.py
  2. 20
      heat/tests/engine/test_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

@ -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):

Loading…
Cancel
Save