From: Zane Bitter Date: Tue, 7 May 2013 13:10:10 +0000 (+0200) Subject: Use scheduler for driving autoscaling task X-Git-Tag: 2014.1~638^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=80e3084a91ace801aa2e69fd6be6a711d9184ec3;p=openstack-build%2Fheat-build.git Use scheduler for driving autoscaling task For threads that drive autoscaling events, run them to completion using the task scheduler, to abstract out the sleeping from the main code. Change-Id: I9b21404a171d92d6edbc59d3099d3ee34f08e22d --- diff --git a/heat/engine/resources/autoscaling.py b/heat/engine/resources/autoscaling.py index 18cbe534..8d9a468b 100644 --- a/heat/engine/resources/autoscaling.py +++ b/heat/engine/resources/autoscaling.py @@ -13,8 +13,6 @@ # License for the specific language governing permissions and limitations # under the License. -import eventlet - from heat.common import exception from heat.engine import resource from heat.engine import scheduler @@ -89,8 +87,8 @@ class InstanceGroup(resource.Resource): return creator.step() def _wait_for_activation(self, creator): - while not self.check_active(creator): - eventlet.sleep(1) + if creator is not None: + creator.run_to_completion() def handle_update(self, json_snippet): try: