mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[AWS | AutoScaling] Do not send Instances for update_auto_scaling_group
(Avoids 413 Request Entity Too Large for ASGs with lots of instances)
This commit is contained in:
parent
47a1a930fd
commit
4554335e9e
3 changed files with 26 additions and 1 deletions
|
@ -132,7 +132,7 @@ module Fog
|
|||
|
||||
def update
|
||||
requires :id
|
||||
service.update_auto_scaling_group(id, options)
|
||||
service.update_auto_scaling_group(id, options.reject{|k,v| k == "Instances" })
|
||||
reload
|
||||
end
|
||||
|
||||
|
|
|
@ -71,6 +71,9 @@ module Fog
|
|||
class Mock
|
||||
|
||||
def update_auto_scaling_group(auto_scaling_group_name, options = {})
|
||||
if options.has_key?("Instances")
|
||||
raise Fog::AWS::AutoScaling::ValidationError.new('Instances should not be included in request')
|
||||
end
|
||||
unless self.data[:auto_scaling_groups].has_key?(auto_scaling_group_name)
|
||||
raise Fog::AWS::AutoScaling::ValidationError.new('AutoScalingGroup name not found - null')
|
||||
end
|
||||
|
|
22
tests/aws/models/auto_scaling/groups_test.rb
Normal file
22
tests/aws/models/auto_scaling/groups_test.rb
Normal file
|
@ -0,0 +1,22 @@
|
|||
Shindo.tests('AWS::AutoScaling | group', ['aws', 'auto_scaling_m']) do
|
||||
|
||||
params = {
|
||||
:id => uniq_id,
|
||||
:auto_scaling_group_name => "name",
|
||||
:availability_zones => [],
|
||||
:launch_configuration_name => "lc"
|
||||
}
|
||||
|
||||
lc_params = {
|
||||
:id => params[:launch_configuration_name],
|
||||
:image_id => "image-id",
|
||||
:instance_type => "instance-type",
|
||||
}
|
||||
|
||||
Fog::AWS[:auto_scaling].configurations.new(lc_params).save
|
||||
|
||||
model_tests(Fog::AWS[:auto_scaling].groups, params, true) do
|
||||
@instance.update
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in a new issue