]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Use correct actions for StackResource
authorZane Bitter <zbitter@redhat.com>
Mon, 12 Aug 2013 14:55:36 +0000 (16:55 +0200)
committerZane Bitter <zbitter@redhat.com>
Mon, 12 Aug 2013 14:55:36 +0000 (16:55 +0200)
To perform actions on a stack, we should use the action constants defined
in the Stack, not in another object (and especially not in a Resource).

Change-Id: I3044f6286fc2690c121a3446f42a6896b3ed3271

heat/engine/stack_resource.py

index 5c436361bc8bd0c553cde0edf9869b55ee638e9e..de03960bbb59d6fec234388831f3ef2df16ff2e3 100644 (file)
@@ -80,7 +80,7 @@ class StackResource(resource.Resource):
         self.resource_id_set(nested_id)
 
         stack_creator = scheduler.TaskRunner(self._nested.stack_task,
-                                             action=self.CREATE)
+                                             action=self._nested.CREATE)
         stack_creator.start(timeout=self._nested.timeout_secs())
         return stack_creator
 
@@ -133,7 +133,7 @@ class StackResource(resource.Resource):
                                   % self.name)
 
         suspend_task = scheduler.TaskRunner(self._nested.stack_task,
-                                            action=self.SUSPEND,
+                                            action=self._nested.SUSPEND,
                                             reverse=True)
 
         suspend_task.start(timeout=self._nested.timeout_secs())
@@ -155,7 +155,7 @@ class StackResource(resource.Resource):
                                   % self.name)
 
         resume_task = scheduler.TaskRunner(self._nested.stack_task,
-                                           action=self.RESUME,
+                                           action=self._nested.RESUME,
                                            reverse=False)
 
         resume_task.start(timeout=self._nested.timeout_secs())