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

Merge pull request #491 from ejfinneran/instance_id_fix

DescribeInstances InstanceId param should have index according to AWS Docs
This commit is contained in:
Wesley Beary 2011-09-02 11:43:36 -07:00
commit 4585dc3d64

View file

@ -58,9 +58,12 @@ module Fog
filters = {'instance-id' => [*filters]}
end
params = {}
# when seeking single instance id, old param style provides more accurate data sooner
if filters['instance-id'] && !filters['instance-id'].is_a?(Array)
params.merge!('InstanceId' => filters.delete('instance-id'))
if filters['instance-id']
instance_ids = filters.delete('instance-id')
instance_ids = [instance_ids] unless instance_ids.is_a?(Array)
instance_ids.each_with_index do |id, index|
params.merge!("InstanceId.#{index}" => id)
end
end
params.merge!(Fog::AWS.indexed_filters(filters))