From d88e34df9c0715393f0c611fc0275b460e0ffecf Mon Sep 17 00:00:00 2001 From: Brian Beach Date: Wed, 10 Aug 2011 18:28:08 -0400 Subject: Fix create_scheduled_group_action to support setting to 0. When deciding whether to pass parameter x up to AWS, the code was using 'if x' to test whether it had been changed from the default of None. This didn't work for 0, so I wasn't able to shut down an auto-scaling group by setting the number of instances to 0. The code now uses 'if x is not None' to check whether a parameter has been set. --- boto/ec2/autoscale/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/boto/ec2/autoscale/__init__.py b/boto/ec2/autoscale/__init__.py index 961346e7..6840a4ee 100644 --- a/boto/ec2/autoscale/__init__.py +++ b/boto/ec2/autoscale/__init__.py @@ -485,11 +485,11 @@ class AutoScaleConnection(AWSQueryConnection): 'ScheduledActionName' : name, 'Time' : time.isoformat(), } - if desired_capacity: + if desired_capacity is not None: params['DesiredCapacity'] = desired_capacity - if min_size: + if min_size is not None: params['MinSize'] = min_size - if max_size: + if max_size is not None: params['MaxSize'] = max_size return self.get_status('PutScheduledUpdateGroupAction', params) -- cgit v1.2.1