Merge "parallelize StackResource delete"
This commit is contained in:
commit
4be2474875
@ -223,7 +223,7 @@ class DBInstance(stack_resource.StackResource):
|
||||
return self.create_with_template(templ, self._params())
|
||||
|
||||
def handle_delete(self):
|
||||
self.delete_nested()
|
||||
return self.delete_nested()
|
||||
|
||||
def _resolve_attribute(self, name):
|
||||
'''
|
||||
|
@ -354,7 +354,7 @@ class LoadBalancer(stack_resource.StackResource):
|
||||
self.nested()['LB_instance'].metadata = md
|
||||
|
||||
def handle_delete(self):
|
||||
self.delete_nested()
|
||||
return self.delete_nested()
|
||||
|
||||
def validate(self):
|
||||
'''
|
||||
|
@ -52,7 +52,7 @@ class NestedStack(stack_resource.StackResource):
|
||||
self.properties[PROP_TIMEOUT_MINS])
|
||||
|
||||
def handle_delete(self):
|
||||
self.delete_nested()
|
||||
return self.delete_nested()
|
||||
|
||||
def FnGetAtt(self, key):
|
||||
if key and not key.startswith('Outputs.'):
|
||||
|
@ -158,7 +158,7 @@ class TemplateResource(stack_resource.StackResource):
|
||||
self._to_parameters())
|
||||
|
||||
def handle_delete(self):
|
||||
self.delete_nested()
|
||||
return self.delete_nested()
|
||||
|
||||
def FnGetRefId(self):
|
||||
if not self.nested():
|
||||
|
@ -164,7 +164,22 @@ class StackResource(resource.Resource):
|
||||
logger.info("Stack not found to delete")
|
||||
else:
|
||||
if stack is not None:
|
||||
stack.delete()
|
||||
delete_task = scheduler.TaskRunner(stack.delete)
|
||||
delete_task.start()
|
||||
return delete_task
|
||||
|
||||
def check_delete_complete(self, delete_task):
|
||||
if delete_task is None:
|
||||
return True
|
||||
|
||||
done = delete_task.step()
|
||||
if done:
|
||||
nested_stack = self.nested()
|
||||
if nested_stack.state != (nested_stack.DELETE,
|
||||
nested_stack.COMPLETE):
|
||||
raise exception.Error(nested_stack.status_reason)
|
||||
|
||||
return done
|
||||
|
||||
def handle_suspend(self):
|
||||
stack = self.nested()
|
||||
|
Loading…
Reference in New Issue
Block a user