Skip to content

Commit 2e7eb1d

Browse files
holetserjanja
authored andcommitted
Add quiet_mode to supported SSH options. (#173)
* Add `quiet_mode` to list of supported SSH options. * Add cleanup of dynamic callbacks to agent cleanup.
1 parent 5cc54da commit 2e7eb1d

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

Diff for: lib/bootleg/config.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ defmodule Bootleg.Config do
122122
line = caller.line()
123123
quote do
124124
hook_number = Bootleg.Config.Agent.increment(:next_hook_number)
125-
module_name = String.to_atom("Elixir.Bootleg.Tasks.DynamicCallbacks." <>
125+
module_name = String.to_atom("Elixir.Bootleg.DynamicCallbacks." <>
126126
String.capitalize("#{unquote(position)}") <> String.capitalize("#{unquote(task)}") <>
127127
"#{hook_number}")
128128
defmodule module_name do

Diff for: lib/bootleg/config/agent.ex

+2-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ defmodule Bootleg.Config.Agent do
6060
receive do
6161
{:DOWN, ^ref, :process, _pid, _reason} ->
6262
Enum.each(:code.all_loaded(), fn {module, _file} ->
63-
if String.starts_with?(Atom.to_string(module), "Elixir.Bootleg.DynamicTasks.") do
63+
if String.starts_with?(Atom.to_string(module), "Elixir.Bootleg.DynamicTasks.") ||
64+
String.starts_with?(Atom.to_string(module), "Elixir.Bootleg.DynamicCallbacks.")do
6465
unload_code(module)
6566
end
6667
end)

Diff for: lib/bootleg/ssh.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ defmodule Bootleg.SSH do
147147
def ssh_opt(option), do: option
148148

149149
@ssh_options ~w(user password port key_cb auth_methods connection_timeout id_string
150-
idle_time silently_accept_hosts user_dir timeout connection_timeout identity)a
150+
idle_time silently_accept_hosts user_dir timeout connection_timeout identity quiet_mode)a
151151
def supported_options do
152152
@ssh_options
153153
end

Diff for: test/bootleg/ssh_test.exs

+4
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,8 @@ defmodule Bootleg.SSHTest do
5454
assert [[1, 2]] = SSH.merge_run_results([[1, 2]], [])
5555
assert [[1, 2]] = SSH.merge_run_results([], [[1, 2]])
5656
end
57+
58+
test "supported_options/0" do
59+
assert Enum.member?(SSH.supported_options, :quiet_mode)
60+
end
5761
end

0 commit comments

Comments
 (0)