Commit 1c91c69f6bc497a668fb3d01cb2de39074484915

Stephen Moloney 2016-05-14T12:48:23

simplify supervision tree

diff --git a/lib/supervisor.ex b/lib/supervisor.ex
index 86b775a..a925057 100644
--- a/lib/supervisor.ex
+++ b/lib/supervisor.ex
@@ -23,19 +23,10 @@ defmodule ExOvh.Supervisor do
   def init(client) do
     Og.context(__ENV__, :debug)
 
-    ovh_config = Keyword.fetch!(client.config(), :ovh)
-                           |> Keyword.merge(Defaults.ovh(), fn(k, v1, v2) ->
-                             case {k, v1} do
-                              {_, :nil} -> v2
-                              {:endpoint, v1} -> Defaults.endpoints()[v1]
-                              _ -> v1
-                             end
-                           end)
-                           |> Og.log_return(__ENV__)
+
     webstorage_config = Keyword.get(client.config(), :swift, []) |> Keyword.get(:webstorage, :nil)
     cloudstorage_config = Keyword.get(client.config(), :swift, []) |> Keyword.get(:cloudstorage, :nil)
                           |> Keyword.merge(Defaults.cloudstorage(), fn(_k, v1, v2) -> if v1 == :nil, do: v2, else: v1 end)
-                          |> Og.log_return(__ENV__)
 
     ovh_client = Module.concat(client, Ovh)
     sup_tree = [
@@ -64,10 +55,6 @@ defmodule ExOvh.Supervisor do
         [{cloudstorage_client, {SwiftCache, :start_link, [{ovh_client, cloudstorage_client}]}, :permanent, 10_000, :worker, [SwiftCache]}]
     end
 
-    if sup_tree === [] do
-        raise "No configuration found for ovh."
-    end
-
     supervise(sup_tree, strategy: :one_for_one, max_restarts: 30)
   end