VM dashboard - do not crash on missing configuration
This commit is contained in:
parent
82c12bd234
commit
11270fc7b1
1 changed files with 3 additions and 3 deletions
|
@ -11,12 +11,12 @@ defmodule Meta.OpenNebula do
|
|||
# OpenNebula daemon.
|
||||
@endpoint "/RPC2"
|
||||
|
||||
defp get_opennebula_config(key) do
|
||||
Application.get_env(:meta, :opennebula, []) |> Keyword.get(key)
|
||||
defp get_opennebula_config(key, default \\ nil) do
|
||||
Application.get_env(:meta, :opennebula, []) |> Keyword.get(key, default)
|
||||
end
|
||||
|
||||
def get_locations() do
|
||||
get_opennebula_config(:locations)
|
||||
get_opennebula_config(:locations, [])
|
||||
|> Enum.map(fn m -> Map.get(m, :name) end)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue