mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
InstanceId should have index according to AWS Docs
- Even if there is only one InstanceId, the docs seem to indicate we should include an index. - OpenStack's API expects the index in all cases so this will fix compatibility there as well.
This commit is contained in:
parent
a0d3fe9dd2
commit
2dd7c1aeaf
1 changed files with 6 additions and 3 deletions
|
@ -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))
|
||||
|
||||
|
|
Loading…
Reference in a new issue