From: Steven Hardy Date: Wed, 10 Oct 2012 17:51:20 +0000 (+0100) Subject: heat engine : only attempt stack update from valid states X-Git-Tag: 2014.1~1328 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=96c9b50778ab3fc36d33544e6d6510d75e09c044;p=openstack-build%2Fheat-build.git heat engine : only attempt stack update from valid states Only attempt to update a stack if it is in CREATE_COMPLETE or UPDATE_COMPLETE state Fixes #260 Change-Id: If47a628f1602d5d8783b3f0e90fd7e76ccef46ba Signed-off-by: Steven Hardy --- diff --git a/heat/engine/parser.py b/heat/engine/parser.py index b3142d6a..e6192230 100644 --- a/heat/engine/parser.py +++ b/heat/engine/parser.py @@ -459,7 +459,11 @@ class Stack(object): Update will fail if it exceeds the specified timeout. The default is 60 minutes, set in the constructor ''' - self.state_set(self.UPDATE_IN_PROGRESS, 'Stack update started') + if self.state not in (self.CREATE_COMPLETE, self.UPDATE_COMPLETE): + self.state_set(self.UPDATE_FAILED, 'State invalid for update') + return + else: + self.state_set(self.UPDATE_IN_PROGRESS, 'Stack update started') # Now make the resources match the new stack definition failures = []