mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Sometimes :Environments is not a key
This commit is contained in:
parent
1955da2027
commit
0bee5e8f42
1 changed files with 5 additions and 3 deletions
|
@ -15,10 +15,12 @@ module Fog
|
|||
def all
|
||||
data = []
|
||||
service.get_organization(href).body[:Locations][:Location].each do |d|
|
||||
if d[:Environments][:Environment].is_a?(Array)
|
||||
d[:Environments][:Environment].each { |e| data << e }
|
||||
environments = d[:Environments]
|
||||
next unless environments
|
||||
if environments[:Environment].is_a?(Array)
|
||||
environments[:Environment].each { |e| data << e }
|
||||
else
|
||||
data << d[:Environments][:Environment]
|
||||
data << environments[:Environment]
|
||||
end
|
||||
end
|
||||
load(data)
|
||||
|
|
Loading…
Reference in a new issue