Commit a8afd49489b4379d1e1f2da4d2caca62b74a1ce3

Stephen Moloney 2016-05-24T09:52:25

fixes

diff --git a/docs/getting_started_advanced.md b/docs/getting_started_advanced.md
index 6063aac..5837749 100644
--- a/docs/getting_started_advanced.md
+++ b/docs/getting_started_advanced.md
@@ -92,4 +92,13 @@ config :openstex,
               connect_timeout: 30000, # 30 seconds
               receive_timeout: (60000 * 30) # 30 minutes
              ]
+```
+
+- Add the client to your project.
+
+```elixir
+defmodule MyApp.OvhClient do
+  @moduledoc :false
+  use ExOvh.Client, otp_app: :my_app
+end
 ```
\ No newline at end of file
diff --git a/lib/client.ex b/lib/client.ex
index e812f87..23a273f 100644
--- a/lib/client.ex
+++ b/lib/client.ex
@@ -108,8 +108,10 @@ defmodule ExOvh.Client do
         ExOvh.Supervisor.start_link(__MODULE__, sup_opts)
       end
 
+
       # client definitions
 
+
       defmodule Ovh do
         @moduledoc ExOvh.Client.ovh_docs()
         use Openstex.Client, client: __MODULE__
@@ -127,6 +129,7 @@ defmodule ExOvh.Client do
         end
       end
 
+
       defmodule Swift.Webstorage do
         @moduledoc ExOvh.Client.swift_docs()
         use Openstex.Client, client: __MODULE__
@@ -141,9 +144,9 @@ defmodule ExOvh.Client do
         @doc "Returns the swift account string."
         @spec account() :: String.t
         def account(), do: __MODULE__.cache().get_swift_account(__MODULE__)
-
       end
 
+
       defmodule Swift.Cloudstorage do
         @moduledoc ExOvh.Client.swift_docs()
         use Openstex.Client, client: __MODULE__
@@ -161,9 +164,9 @@ defmodule ExOvh.Client do
         @doc "Returns the swift account string."
         @spec account() :: String.t
         def account(), do: __MODULE__.cache().get_swift_account(__MODULE__)
-
       end
 
+
     end
   end
 
diff --git a/lib/ovh/v1/cloud/query.ex b/lib/ovh/v1/cloud/query.ex
index c342932..845e0ff 100644
--- a/lib/ovh/v1/cloud/query.ex
+++ b/lib/ovh/v1/cloud/query.ex
@@ -584,7 +584,7 @@ defmodule ExOvh.Ovh.V1.Cloud.Query do
   """
   @spec create_project_alert(String.t, String.t, integer, String.t) :: Query.t | no_return
   def create_project_alert(service_name, email, monthly_threshold, delay \\ "3600") do
-    unless is_integer(monthly_threshold), do: Og.log_return(__ENV__,  "monthly_threshold should be an integer!", :error) |> raise()
+    unless is_integer(monthly_threshold), do: Og.log_return("monthly_threshold should be an integer!", __ENV__, :error) |> raise()
     %Query{
           method: :post,
           uri: "/cloud/project/#{service_name}/alerting",
@@ -644,7 +644,7 @@ defmodule ExOvh.Ovh.V1.Cloud.Query do
   """
   @spec modify_project_alert(String.t, String.t, String.t, integer, String.t) :: Query.t
   def modify_project_alert(service_name, alert_id, email, monthly_threshold, delay \\ "3600") do
-    unless is_integer(monthly_threshold), do: Og.log_return(__ENV__,  "monthly_threshold should be an integer!", :error) |> raise()
+    unless is_integer(monthly_threshold), do: Og.log_return("monthly_threshold should be an integer!", __ENV__, :error) |> raise()
     %Query{
           method: :put,
           uri: "/cloud/project/#{service_name}/alerting/#{alert_id}",
diff --git a/lib/supervisor.ex b/lib/supervisor.ex
index 0d19fbf..8e8cc7b 100644
--- a/lib/supervisor.ex
+++ b/lib/supervisor.ex
@@ -26,7 +26,11 @@ defmodule ExOvh.Supervisor do
 
     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)
+    cloudstorage_config =
+    case cloudstorage_config do
+      :nil -> :nil
+      _ -> Keyword.merge(cloudstorage_config, Defaults.cloudstorage(), fn(_k, v1, v2) -> if v1 == :nil, do: v2, else: v1 end)
+    end
 
     ovh_client = Module.concat(client, Ovh)
     sup_tree = [