appoxy / aws

Amazon Web Services (AWS) Ruby Gem
https://rubygems.org/gems/aws
236 stars 87 forks source link

Bug in method hash_params_with_suffix #138

Closed plaa closed 8 years ago

plaa commented 8 years ago

Any usage of hash_params_with_suffix is broken in 2.10.2. Instead of using the suffix parameter value, it uses the fixed string 'suffix'.

In ec2.rb instead of:

list.each_index { |i| groups.update("#{prefix}.#{i+1}.suffix"=>list[i]) }

it should be:

list.each_index { |i| groups.update("#{prefix}.#{i+1}.#{suffix}"=>list[i]) }

This can be patched in user code with:

module Aws
  class Ec2 < AwsBase
    def hash_params_with_suffix(prefix, suffix, list) #:nodoc:
      groups = {}
      list.each_index { |i| groups.update("#{prefix}.#{i+1}.#{suffix}"=>list[i]) }
      return groups
    end
  end
end
treeder commented 8 years ago

Can you make a pull request for that patch?

plaa commented 8 years ago

Some mess-up with the pull requests, the latter is the proper one.