Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

[compute|aws] - Change modify_instance_attribute name to match EC2 API me #489

Merged
merged 1 commit into from

2 participants

@ctennis

This method doesn't really do anything, so make it work.

As well, the EC2 API method is '_attribute', and the filename is '_attribute', and the two other similar methods are '_attribute', but for some reason this method got named '_attributes'. Fix that, and add a depcrecation warning to the old method.

@geemus
Owner

Great, thanks for the cleanup!

@geemus geemus merged commit c5cb84a into fog:master
@alanthing alanthing referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 31, 2011
  1. @ctennis

    [compute|aws] - Change modify_instance_attribute name to match EC2 AP…

    ctennis authored
    …I method, and actually make it do something
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 3 deletions.
  1. +9 −3 lib/fog/aws/requests/compute/modify_instance_attribute.rb
View
12 lib/fog/aws/requests/compute/modify_instance_attribute.rb
@@ -20,10 +20,11 @@ class Real
# 'GroupId'<~Array> - One or more groups to add instance to (VPC only)
#
# {Amazon API Reference}[http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-ModifyInstanceAttribute.html]
- #
- def modify_instance_attributes(instance_id, attributes)
+ #
+ def modify_instance_attribute(instance_id, attributes)
params = {}
- params.merge!(Fog::AWS.indexed_param('GroupId', attributes['GroupId'] || []))
+ params.merge!(Fog::AWS.indexed_param('GroupId', attributes.delete('GroupId') || []))
+ params.merge!(attributes)
request({
'Action' => 'ModifyInstanceAttribute',
'InstanceId' => instance_id,
@@ -31,6 +32,11 @@ def modify_instance_attributes(instance_id, attributes)
:parser => Fog::Parsers::Compute::AWS::Basic.new
}.merge!(params))
end
+
+ def modify_instance_attributes(instance_id, attributes)
+ Formatador.display_line("[yellow][WARN] modify_instance_attributes method is deprecated, use 'modify_instance_attribute' instead[/]")
+ modify_instance_attribute(instance_id, attributes)
+ end
end
end
Something went wrong with that request. Please try again.