From 53447e67fd0d14888a29e1bd683c2ff99a06bac6 Mon Sep 17 00:00:00 2001 From: Angus Salkeld Date: Tue, 8 May 2012 14:26:23 +1000 Subject: [PATCH] Make the wait condition behave better when the stack is deleted. Signed-off-by: Angus Salkeld --- heat/engine/wait_condition.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/heat/engine/wait_condition.py b/heat/engine/wait_condition.py index 7b30c97a..6e012247 100644 --- a/heat/engine/wait_condition.py +++ b/heat/engine/wait_condition.py @@ -113,7 +113,6 @@ class WaitCondition(Resource): # keep polling our Metadata to see if the cfn-signal has written # it yet. The execution here is limited by timeout. - print 'timeout %d' % self.timeout tmo = eventlet.Timeout(self.timeout) status = 'WAITING' reason = '' @@ -126,8 +125,8 @@ class WaitCondition(Resource): self.stack.parsed_template_id) except Exception as ex: if 'not found' in ex: - # entry deleted - return + # it has been deleted + status = 'DELETED' else: pass @@ -153,6 +152,9 @@ class WaitCondition(Resource): if status == 'SUCCESS': self.state_set(self.CREATE_COMPLETE, '%s: %s' % (self.name, reason)) + elif status == 'DELETED': + # don't try write to the db as it's gone. + pass else: raise exception.Error(reason) -- 2.45.2