From 320999bf804869e6579c2d555bf211e17c86858d Mon Sep 17 00:00:00 2001 From: Steven Hardy Date: Wed, 17 Oct 2012 14:38:08 +0100 Subject: [PATCH] heat engine : Store all resource states to DB Resources should be committed to the DB on transisiton to CREATE_IN_PROGRESS state, otherwise resources which take a long time to go from CREATE_IN_PROGRESS to CREATE_COMPLETE (e.g WaitConditions) are invisible while in the CREATE_IN_PROGRESS state to all except the thread creating them. Change-Id: If1563505e854c216c0f6a5ce84b613e1ccb74386 Signed-off-by: Steven Hardy --- heat/engine/resources.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/heat/engine/resources.py b/heat/engine/resources.py index a2e5f99c..90439c82 100644 --- a/heat/engine/resources.py +++ b/heat/engine/resources.py @@ -510,7 +510,10 @@ class Resource(object): except Exception as ex: logger.error('DB error %s' % str(ex)) - elif new_state in (self.CREATE_COMPLETE, self.CREATE_FAILED): + # store resource in DB on transition to CREATE_IN_PROGRESS + # all other transistions (other than to DELETE_COMPLETE) + # should be handled by the update_and_save above.. + elif new_state == self.CREATE_IN_PROGRESS: self._store() if new_state != old_state: -- 2.45.2