From 6a911f41e6337823dd39ee9e120d0e706495bd0e Mon Sep 17 00:00:00 2001 From: Gabriel Rosendorf Date: Tue, 17 Sep 2013 10:51:36 -0400 Subject: [PATCH] cleaned up logic for multiple security groups for vpc instances with manually specified network interfaces --- lib/fog/aws/models/compute/server.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/fog/aws/models/compute/server.rb b/lib/fog/aws/models/compute/server.rb index 640064f8d..59124422c 100644 --- a/lib/fog/aws/models/compute/server.rb +++ b/lib/fog/aws/models/compute/server.rb @@ -178,11 +178,9 @@ module Fog options['NetworkInterface.0.AssociatePublicIpAddress'] = associate_public_ip options['NetworkInterface.0.SubnetId'] = options['SubnetId'] options.delete('SubnetId') - grp_num = 0 if options['SecurityGroupId'].kind_of?(Array) options['SecurityGroupId'].each {|id| - options["NetworkInterface.0.SecurityGroupId.#{grp_num}"] = id - grp_num += 1 + options["NetworkInterface.0.SecurityGroupId.#{options['SecurityGroupId'].index(id)}"] = id } else options["NetworkInterface.0.SecurityGroupId.0"] = options['SecurityGroupId']