]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Make the wait condition behave better when the stack is deleted.
authorAngus Salkeld <asalkeld@redhat.com>
Tue, 8 May 2012 04:26:23 +0000 (14:26 +1000)
committerAngus Salkeld <asalkeld@redhat.com>
Wed, 16 May 2012 10:00:39 +0000 (20:00 +1000)
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
heat/engine/wait_condition.py

index 7b30c97abbec4340f3421256a32b35359d850bde..6e01224750800fc8bc89ee2f8ee7d0c1685b4284 100644 (file)
@@ -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)