1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

cleaned up logic for multiple security groups for vpc instances with manually specified network interfaces

This commit is contained in:
Gabriel Rosendorf 2013-09-17 10:51:36 -04:00
parent e4d4b0e685
commit 6a911f41e6

View file

@ -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']