From: Zane Bitter Date: Fri, 31 May 2013 10:39:08 +0000 (+0200) Subject: Implement timeouts for nested stacks X-Git-Tag: 2014.1~533 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=17e15a638d877578b26dd59240d53b4e615455df;p=openstack-build%2Fheat-build.git Implement timeouts for nested stacks This also means that if no default is specified, nested stacks will not time out (previously they used the default timeout of 60 minutes). Of course, like other resources, creation of the nested stack will stop if and when the parent stack times out. Change-Id: Ibd55c32d63e971f79319ed40321fa4be52b65419 --- diff --git a/heat/engine/resources/stack.py b/heat/engine/resources/stack.py index 739d91d7..f4456575 100644 --- a/heat/engine/resources/stack.py +++ b/heat/engine/resources/stack.py @@ -42,7 +42,9 @@ class NestedStack(stack_resource.StackResource): template_data = urlfetch.get(self.properties[PROP_TEMPLATE_URL]) template = template_format.parse(template_data) - self.create_with_template(template, self.properties[PROP_PARAMETERS]) + self.create_with_template(template, + self.properties[PROP_PARAMETERS], + self.properties[PROP_TIMEOUT_MINS]) def handle_delete(self): self.delete_nested() diff --git a/heat/engine/stack_resource.py b/heat/engine/stack_resource.py index a3b95c9f..2040e73f 100644 --- a/heat/engine/stack_resource.py +++ b/heat/engine/stack_resource.py @@ -45,7 +45,8 @@ class StackResource(resource.Resource): return self._nested - def create_with_template(self, child_template, user_params): + def create_with_template(self, child_template, user_params, + timeout_mins=None): ''' Handle the creation of the nested stack from a given JSON template. ''' @@ -59,6 +60,7 @@ class StackResource(resource.Resource): self.physical_resource_name(), template, params, + timeout_mins=timeout_mins, disable_rollback=True) nested_id = self._nested.store(self.stack)