Cleanup updating ASGs. Closes #603.
This commit is contained in:
parent
fd99434b7b
commit
8ce2d3c8bf
@ -217,17 +217,24 @@ class FakeAutoScalingGroup(object):
|
|||||||
launch_config_name, vpc_zone_identifier, default_cooldown,
|
launch_config_name, vpc_zone_identifier, default_cooldown,
|
||||||
health_check_period, health_check_type, load_balancers,
|
health_check_period, health_check_type, load_balancers,
|
||||||
placement_group, termination_policies):
|
placement_group, termination_policies):
|
||||||
|
if availability_zones:
|
||||||
self.availability_zones = availability_zones
|
self.availability_zones = availability_zones
|
||||||
|
if max_size is not None:
|
||||||
self.max_size = max_size
|
self.max_size = max_size
|
||||||
|
if min_size is not None:
|
||||||
self.min_size = min_size
|
self.min_size = min_size
|
||||||
|
|
||||||
if launch_config_name:
|
if launch_config_name:
|
||||||
self.launch_config = self.autoscaling_backend.launch_configurations[launch_config_name]
|
self.launch_config = self.autoscaling_backend.launch_configurations[launch_config_name]
|
||||||
self.launch_config_name = launch_config_name
|
self.launch_config_name = launch_config_name
|
||||||
|
if vpc_zone_identifier is not None:
|
||||||
self.vpc_zone_identifier = vpc_zone_identifier
|
self.vpc_zone_identifier = vpc_zone_identifier
|
||||||
|
if health_check_period is not None:
|
||||||
self.health_check_period = health_check_period
|
self.health_check_period = health_check_period
|
||||||
|
if health_check_type is not None:
|
||||||
self.health_check_type = health_check_type
|
self.health_check_type = health_check_type
|
||||||
|
|
||||||
|
if desired_capacity is not None:
|
||||||
self.set_desired_capacity(desired_capacity)
|
self.set_desired_capacity(desired_capacity)
|
||||||
|
|
||||||
def set_desired_capacity(self, new_capacity):
|
def set_desired_capacity(self, new_capacity):
|
||||||
|
@ -437,5 +437,9 @@ def test_update_autoscaling_group_boto3():
|
|||||||
response = client.update_auto_scaling_group(
|
response = client.update_auto_scaling_group(
|
||||||
AutoScalingGroupName='test_asg',
|
AutoScalingGroupName='test_asg',
|
||||||
MinSize=1,
|
MinSize=1,
|
||||||
DesiredCapacity=1,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
response = client.describe_auto_scaling_groups(
|
||||||
|
AutoScalingGroupNames=["test_asg"]
|
||||||
|
)
|
||||||
|
response['AutoScalingGroups'][0]['MinSize'].should.equal(1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user