summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Beach <coder@beachfamily.net>2011-08-10 18:28:08 -0400
committerMitch Garnaat <mitch@garnaat.com>2011-08-10 17:32:31 -0700
commitd88e34df9c0715393f0c611fc0275b460e0ffecf (patch)
tree35c2835d5f8e215d7d1f82c309e686c200fd0962
parent7aba9173fbe147e99d7a9722cc9cd53f2d942ab5 (diff)
downloadboto-2.0_stable.tar.gz
Fix create_scheduled_group_action to support setting to 0.2.0_stable
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.
-rw-r--r--boto/ec2/autoscale/__init__.py6
1 files 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)