mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[aws|compute] model level warnings/fixes for filters
This commit is contained in:
parent
40ab6052ea
commit
a1374e9aa5
6 changed files with 24 additions and 3 deletions
|
@ -18,6 +18,10 @@ module Fog
|
|||
end
|
||||
|
||||
def all(filters = @filters)
|
||||
unless filters.is_a?(Hash)
|
||||
Formatador.display_line("[yellow][WARN] all with #{filters.class} param is deprecated, use all('public-ip' => []) instead[/] [light_black](#{caller.first})[/]")
|
||||
filters = {'public-ip' => [*filters]}
|
||||
end
|
||||
@filters = filters
|
||||
data = connection.describe_addresses(filters).body
|
||||
load(
|
||||
|
|
|
@ -17,6 +17,10 @@ module Fog
|
|||
end
|
||||
|
||||
def all(filters = @filters)
|
||||
unless filters.is_a?(Hash)
|
||||
Formatador.display_line("[yellow][WARN] all with #{filters.class} param is deprecated, use all('key-name' => []) instead[/] [light_black](#{caller.first})[/]")
|
||||
filters = {'key-name' => [*filters]}
|
||||
end
|
||||
@filters = filters
|
||||
data = connection.describe_key_pairs(filters).body
|
||||
load(data['keySet'])
|
||||
|
|
|
@ -17,6 +17,10 @@ module Fog
|
|||
end
|
||||
|
||||
def all(filters = @filters)
|
||||
unless filters.is_a?(Hash)
|
||||
Formatador.display_line("[yellow][WARN] all with #{filters.class} param is deprecated, use all('group-name' => []) instead[/] [light_black](#{caller.first})[/]")
|
||||
filters = {'group-name' => [*filters]}
|
||||
end
|
||||
@filters = filters
|
||||
data = connection.describe_security_groups(@filters).body
|
||||
load(data['securityGroupInfo'])
|
||||
|
|
|
@ -19,6 +19,10 @@ module Fog
|
|||
end
|
||||
|
||||
def all(filters = @filters)
|
||||
unless filters.is_a?(Hash)
|
||||
Formatador.display_line("[yellow][WARN] all with #{filters.class} param is deprecated, use all('instance-id' => []) instead[/] [light_black](#{caller.first})[/]")
|
||||
filters = {'instance-id' => [*filters]}
|
||||
end
|
||||
@filters = filters
|
||||
data = connection.describe_instances(filters).body
|
||||
load(
|
||||
|
|
|
@ -18,10 +18,11 @@ module Fog
|
|||
end
|
||||
|
||||
def all(filters = @filters, options = {})
|
||||
unless options.empty?
|
||||
Formatador.display_line("[yellow][WARN] describe_snapshots with a second param is deprecated, use describe_snapshots(options) instead[/] [light_black](#{caller.first})[/]")
|
||||
filters.merge!(options)
|
||||
unless filters.is_a?(Hash)
|
||||
Formatador.display_line("[yellow][WARN] all with #{filters.class} param is deprecated, use all('snapshot-id' => []) instead[/] [light_black](#{caller.first})[/]")
|
||||
filters = {'snapshot-id' => [*filters]}
|
||||
end
|
||||
@filters = filters
|
||||
data = connection.describe_snapshots(filters.merge!(options)).body
|
||||
load(data['snapshotSet'])
|
||||
if volume
|
||||
|
|
|
@ -18,6 +18,10 @@ module Fog
|
|||
end
|
||||
|
||||
def all(filters = @filters)
|
||||
unless filters.is_a?(Hash)
|
||||
Formatador.display_line("[yellow][WARN] all with #{filters.class} param is deprecated, use all('volume-id' => []) instead[/] [light_black](#{caller.first})[/]")
|
||||
filters = {'volume-id' => [*filters]}
|
||||
end
|
||||
@filters = filters
|
||||
data = connection.describe_volumes(@filters).body
|
||||
load(data['volumeSet'])
|
||||
|
|
Loading…
Add table
Reference in a new issue