minor changes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 717b19d..cd073b7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changelog
+## v0.1.3
+
+- Improve the `mix ovh` docs to better illustrate how to create an application and setup access rules.
+
## v0.1.2
- Fix `mix ovh` task.
diff --git a/lib/ex_ovh/supervisor.ex b/lib/ex_ovh/supervisor.ex
index ca35781..6ec6be5 100644
--- a/lib/ex_ovh/supervisor.ex
+++ b/lib/ex_ovh/supervisor.ex
@@ -21,7 +21,7 @@ defmodule ExOvh.Supervisor do
[
{client, {ExOvh.Config, :start_agent, [client, opts]}, :permanent, 10_000, :worker, [ExOvh.Config]}
]
- supervise(sup_tree, strategy: :one_for_one, max_restarts: 30)
+ supervise(sup_tree, strategy: :one_for_one, max_restarts: 3, max_seconds: 60) # max restarts 3 in one minute
end
diff --git a/lib/mix/tasks/ovh.ex b/lib/mix/tasks/ovh.ex
index 7ed7460..f41ff76 100644
--- a/lib/mix/tasks/ovh.ex
+++ b/lib/mix/tasks/ovh.ex
@@ -60,16 +60,16 @@ defmodule Mix.Tasks.Ovh do
defp has_required_args(opts) do
login = Keyword.get(opts, :login, :nil)
- if login === :nil do
+ if login == :nil do
raise "Task requires login argument"
end
password = Keyword.get(opts, :password, :nil)
- if password === :nil do
+ if password == :nil do
raise "Task requires password argument"
end
{opts, %{}}
application_name = Keyword.get(opts, :appname, :ex_ovh)
- if application_name === :nil do
+ if application_name == :nil do
raise "Task requires appname argument"
end
{opts, %{}}
@@ -126,7 +126,7 @@ defmodule Mix.Tasks.Ovh do
defp parsers_access_rules({opts, acc}) do
access_rules = Keyword.get(opts, :accessrules, :nil)
access_rules =
- if access_rules === :nil do
+ if access_rules == :nil do
Defaults.access_rules()
else
String.split(access_rules, "::")
@@ -173,7 +173,7 @@ defmodule Mix.Tasks.Ovh do
inputs = Floki.find(resp_body, "form input")
|> List.flatten()
- if Enum.any?(inputs, fn(input) -> input === [] end), do: raise "Empty input found"
+ if Enum.any?(inputs, fn(input) -> input == [] end), do: raise "Empty input found"
inputs
end
@@ -199,7 +199,7 @@ defmodule Mix.Tasks.Ovh do
end
param = name <> "=" <> value
{acc, index, max} = acc
- if index === max do
+ if index == max do
acc = acc <> param
else
acc = acc <> param <> "&"
@@ -299,7 +299,7 @@ defmodule Mix.Tasks.Ovh do
|> Enum.filter(fn({_type, input, _options}) ->
:proplists.get_value("name", input) !== "identifiant"
end)
- if Enum.any?(inputs, fn(input) -> input === [] end), do: raise "Inputs should not be empty"
+ if Enum.any?(inputs, fn(input) -> input == [] end), do: raise "Inputs should not be empty"
inputs
end
@@ -332,7 +332,7 @@ defmodule Mix.Tasks.Ovh do
end
param = name_val <> "=" <> value
{acc, index, max} = acc
- if index === max do
+ if index == max do
acc = acc <> param
else
acc = acc <> param <> "&"