Fix min_size reference where type is None (#53669)

pull/53769/head
Jason Witkowski 6 years ago committed by ansibot
parent 33939f7fe8
commit acdb4c3ede

@ -0,0 +1,2 @@
bugfixes:
- ec2_asg - Fix scenario where min_size can end up passing None type to boto

@ -1488,6 +1488,8 @@ def terminate_batch(connection, replace_instances, initial_instances, leftovers=
if num_new_inst_needed == 0: if num_new_inst_needed == 0:
decrement_capacity = True decrement_capacity = True
if as_group['MinSize'] != min_size: if as_group['MinSize'] != min_size:
if min_size is None:
min_size = as_group['MinSize']
updated_params = dict(AutoScalingGroupName=as_group['AutoScalingGroupName'], MinSize=min_size) updated_params = dict(AutoScalingGroupName=as_group['AutoScalingGroupName'], MinSize=min_size)
update_asg(connection, **updated_params) update_asg(connection, **updated_params)
module.debug("Updating minimum size back to original of %s" % min_size) module.debug("Updating minimum size back to original of %s" % min_size)

Loading…
Cancel
Save