1
0
Fork 0
mirror of https://github.com/fog/fog-aws.git synced 2022-11-09 13:50:52 -05:00

Merge pull request #397 from engineyard/fix-detach-instances

Fix detaching instances from auto scaling group.
This commit is contained in:
Josh Lane 2017-09-25 13:48:15 -07:00 committed by GitHub
commit 973eed7b9a

View file

@ -13,9 +13,7 @@ module Fog
#
# * AutoScalingGroupName<~String> - The name of the Auto Scaling group``
# * 'InstanceIds'<~Array> - The list of Auto Scaling instances to detach.
#
# * options<~Hash>:
# 'shouldDecrementDesiredCapacity'<~Boolean> - decrement the asg capacity or not (it will boot another if an instance id detached)
# * ShouldDecrementDesiredCapacity<~Boolean> - decrement the asg capacity or not (it will boot another if an instance id detached)
#
# ==== See Also
#
@ -23,6 +21,7 @@ module Fog
ExpectedOptions[:asg_name] = %w[AutoScalingGroupName]
ExpectedOptions[:instance_ids] = %w[InstanceIds]
ExpectedOptions[:should_decrement_desired_capacity] = %w[ShouldDecrementDesiredCapacity]
def detach_instances(auto_scaling_group_name, options = {})
@ -46,7 +45,7 @@ module Fog
class Mock
def detach_instances(auto_scaling_group_name, options = {})
unexpected_options = options.keys - ExpectedOptions[:asg_name] - ExpectedOptions[:instance_ids]
unexpected_options = options.keys - ExpectedOptions[:asg_name] - ExpectedOptions[:instance_ids] - ExpectedOptions[:should_decrement_desired_capacity]
unless unexpected_options.empty?
raise Fog::AWS::AutoScaling::ValidationError.new("Options #{unexpected_options.join(',')} should not be included in request")