Permalink
Browse files

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.
  • Loading branch information...
1 parent 7aba917 commit d88e34df9c0715393f0c611fc0275b460e0ffecf @bwbeach bwbeach committed with garnaat Aug 10, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 boto/ec2/autoscale/__init__.py
@@ -485,11 +485,11 @@ def create_scheduled_group_action(self, as_group, name, time, desired_capacity=N
'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)

0 comments on commit d88e34d

Please sign in to comment.