From 93b56df04d015957158b39d90bd2f2f8d8e6b438 Mon Sep 17 00:00:00 2001 From: Caleb Tennis Date: Wed, 31 Aug 2011 04:18:43 -0400 Subject: [PATCH] [compute|aws] - Change modify_instance_attribute name to match EC2 API method, and actually make it do something --- .../requests/compute/modify_instance_attribute.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/fog/aws/requests/compute/modify_instance_attribute.rb b/lib/fog/aws/requests/compute/modify_instance_attribute.rb index 0f38620a9..2c75fe03b 100644 --- a/lib/fog/aws/requests/compute/modify_instance_attribute.rb +++ b/lib/fog/aws/requests/compute/modify_instance_attribute.rb @@ -20,10 +20,11 @@ module Fog # '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 @@ module Fog :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