diff --git a/lib/fog/aws/models/auto_scaling/group.rb b/lib/fog/aws/models/auto_scaling/group.rb index 97843dcc7..57fc6a604 100644 --- a/lib/fog/aws/models/auto_scaling/group.rb +++ b/lib/fog/aws/models/auto_scaling/group.rb @@ -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 diff --git a/lib/fog/aws/requests/auto_scaling/update_auto_scaling_group.rb b/lib/fog/aws/requests/auto_scaling/update_auto_scaling_group.rb index d3beb75ab..716f43235 100644 --- a/lib/fog/aws/requests/auto_scaling/update_auto_scaling_group.rb +++ b/lib/fog/aws/requests/auto_scaling/update_auto_scaling_group.rb @@ -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 diff --git a/tests/aws/models/auto_scaling/groups_test.rb b/tests/aws/models/auto_scaling/groups_test.rb new file mode 100644 index 000000000..43874727f --- /dev/null +++ b/tests/aws/models/auto_scaling/groups_test.rb @@ -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