diff options
author | Saku Ytti <saku@ytti.fi> | 2014-04-14 16:28:23 +0300 |
---|---|---|
committer | Saku Ytti <saku@ytti.fi> | 2014-04-14 16:28:23 +0300 |
commit | 57a8f4bc04b4f87ad0d7028dcbf29b96d49eaffd (patch) | |
tree | 82567c791b0114e62fa3b978eb2bb95733d6488b /lib/oxidized/input/ssh.rb | |
parent | 1a1794b2b3ac99764852546c550fd7988f84c37b (diff) |
Use 'asetus' for configuration files
Main benefits
a) we get support for system wide configs
b) we don't use symbols in config file, they're confusing to
non-rubyist
Diffstat (limited to 'lib/oxidized/input/ssh.rb')
-rw-r--r-- | lib/oxidized/input/ssh.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/oxidized/input/ssh.rb b/lib/oxidized/input/ssh.rb index dae1d74..570f8a8 100644 --- a/lib/oxidized/input/ssh.rb +++ b/lib/oxidized/input/ssh.rb @@ -12,14 +12,14 @@ module Oxidized Net::SSH::AuthenticationFailed, ], } - include CLI + include Input::CLI class NoShell < OxidizedError; end def connect node @node = node @output = '' @node.model.cfg['ssh'].each { |cb| instance_exec(&cb) } - secure = CFG.input[:ssh][:secure] + secure = CFG.input.ssh.secure @ssh = Net::SSH.start @node.ip, @node.auth[:username], :password => @node.auth[:password], :timeout => CFG.timeout, :paranoid => secure @@ -64,14 +64,14 @@ module Oxidized def shell_open ssh @ses = ssh.open_channel do |ch| - ch.on_data do |ch, data| + ch.on_data do |_ch, data| @output << data @output = @node.model.expects @output end - ch.request_pty do |ch, success| - raise NoShell, "Can't get PTY" unless success - ch.send_channel_request 'shell' do |ch, success| - raise NoShell, "Can't get shell" unless success + ch.request_pty do |_ch, success_pty| + raise NoShell, "Can't get PTY" unless success_pty + ch.send_channel_request 'shell' do |_ch, success_shell| + raise NoShell, "Can't get shell" unless success_shell end end end |