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

[aws|compute] use old style, more consistent call to get single instance

This commit is contained in:
geemus 2011-05-11 16:09:13 -07:00
parent 2be572ff23
commit 76444cb484

View file

@ -55,7 +55,12 @@ module Fog
Formatador.display_line("[yellow][WARN] describe_instances with #{filters.class} param is deprecated, use describe_instances('instance-id' => []) instead[/] [light_black](#{caller.first})[/]")
filters = {'instance-id' => [*filters]}
end
params = AWS.indexed_filters(filters)
params = {}
# when seeking single instance id, old param style is most up to date
if filters['instance-id'] && !filters['instance-id'].is_a?(Array)
params.merge('InstanceId' => filters.delete('instance-id'))
end
params.merge!(AWS.indexed_filters(filters))
request({
'Action' => 'DescribeInstances',