]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Implement timeouts for nested stacks
authorZane Bitter <zbitter@redhat.com>
Fri, 31 May 2013 10:39:08 +0000 (12:39 +0200)
committerZane Bitter <zbitter@redhat.com>
Fri, 31 May 2013 10:40:08 +0000 (12:40 +0200)
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

heat/engine/resources/stack.py
heat/engine/stack_resource.py

index 739d91d7f47127b7662e8384190cc55206b599bd..f44565758e7b040b190cb7d4c6be9b1e7305d001 100644 (file)
@@ -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()
index a3b95c9f6345571049a3e52df7b95cce4020f60e..2040e73f66fa394fe4c04a39ff24bf26ffe560dd 100644 (file)
@@ -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)