diff options
author | Saku Ytti <saku@ytti.fi> | 2018-06-27 19:50:59 +0300 |
---|---|---|
committer | Saku Ytti <saku@ytti.fi> | 2018-06-27 19:50:59 +0300 |
commit | 55602de1caa49016a2b54a34424e08c37ab2f398 (patch) | |
tree | 1dc36aaa8bf64ff012b3721facce5ed0b4baf6bf | |
parent | 23603127362e6f4a7606325501a3ce26ef8317a1 (diff) |
Don't use SSH logger unless input debug is set
-rw-r--r-- | lib/oxidized/input/ssh.rb | 7 | ||||
-rw-r--r-- | spec/input/ssh_spec.rb | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/oxidized/input/ssh.rb b/lib/oxidized/input/ssh.rb index d97633d..8caa801 100644 --- a/lib/oxidized/input/ssh.rb +++ b/lib/oxidized/input/ssh.rb @@ -123,7 +123,6 @@ module Oxidized port: (vars(:ssh_port) || 22).to_i, paranoid: secure, keepalive: true, - logger: Oxidized.logger, password: @node.auth[:password], timeout: Oxidized.config.timeout, number_of_password_prompts: 0 @@ -144,7 +143,11 @@ module Oxidized ssh_opts[:keys] = [vars(:ssh_keys)].flatten if vars(:ssh_keys) ssh_opts[:kex] = vars(:ssh_kex).split(/,\s*/) if vars(:ssh_kex) ssh_opts[:encryption] = vars(:ssh_encryption).split(/,\s*/) if vars(:ssh_encryption) - ssh_opts[:verbose] = Logger::DEBUG if Oxidized.config.input.debug? + + if Oxidized.config.input.debug? + ssh_opts[:logger] = Oxidized.logger + ssh_opts[:verbose] = Logger::DEBUG + end ssh_opts end diff --git a/spec/input/ssh_spec.rb b/spec/input/ssh_spec.rb index f9704d4..9864373 100644 --- a/spec/input/ssh_spec.rb +++ b/spec/input/ssh_spec.rb @@ -34,7 +34,6 @@ describe Oxidized::SSH do Net::SSH.expects(:start).with('93.184.216.34', 'alma', port: 22, paranoid: Oxidized.config.input.ssh.secure, keepalive: true, - logger: Oxidized.logger, password: 'armud', timeout: Oxidized.config.timeout, number_of_password_prompts: 0, @@ -66,7 +65,6 @@ describe Oxidized::SSH do Net::SSH.expects(:start).with('example.com', 'alma', port: 22, paranoid: Oxidized.config.input.ssh.secure, keepalive: true, - logger: Oxidized.logger, password: 'armud', timeout: Oxidized.config.timeout, number_of_password_prompts: 0, |