From: Angus Salkeld Date: Tue, 24 Jul 2012 04:03:24 +0000 (+1000) Subject: autoscaling: implement DesiredCapacity X-Git-Tag: 2014.1~1566 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=27e612a77bdde87d417d502251553352fafc8870;p=openstack-build%2Fheat-build.git autoscaling: implement DesiredCapacity Change-Id: I1403f7857e03795aa4773f9a3f1fc8f082526477 Signed-off-by: Angus Salkeld --- diff --git a/heat/engine/autoscaling.py b/heat/engine/autoscaling.py index 86a51857..e599a7f7 100644 --- a/heat/engine/autoscaling.py +++ b/heat/engine/autoscaling.py @@ -42,8 +42,7 @@ class AutoScalingGroup(Resource): 'MinSize': {'Required': True, 'Type': 'String'}, 'Cooldown': {'Type': 'String'}, - 'DesiredCapacity': {'Type': 'String', - 'Implemented': False}, + 'DesiredCapacity': {'Type': 'Integer'}, 'HealthCheckGracePeriod': {'Type': 'Integer', 'Implemented': False}, 'HealthCheckType': {'Type': 'String', @@ -59,7 +58,13 @@ class AutoScalingGroup(Resource): # instance_id is a list of resources def handle_create(self): - self.adjust(int(self.properties['MinSize']), + + if 'DesiredCapacity' in self.properties: + num_to_create = int(self.properties['DesiredCapacity']) + else: + num_to_create = int(self.properties['MinSize']) + + self.adjust(num_to_create, adjustment_type='ExactCapacity') def handle_update(self):