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 | |
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')
-rw-r--r-- | lib/oxidized/input/ssh.rb | 14 | ||||
-rw-r--r-- | lib/oxidized/input/telnet.rb | 2 |
2 files changed, 8 insertions, 8 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 diff --git a/lib/oxidized/input/telnet.rb b/lib/oxidized/input/telnet.rb index 4e80ceb..218b13c 100644 --- a/lib/oxidized/input/telnet.rb +++ b/lib/oxidized/input/telnet.rb @@ -3,7 +3,7 @@ module Oxidized require 'oxidized/input/cli' class Telnet < Input RescueFail = {} - include CLI + include Input::CLI attr_reader :telnet def connect node |