diff options
author | Saku Ytti <saku@ytti.fi> | 2014-02-07 10:36:50 +0200 |
---|---|---|
committer | Saku Ytti <saku@ytti.fi> | 2014-02-07 10:36:50 +0200 |
commit | 028bada99a02f2bc9b5b4409f09715ca49858675 (patch) | |
tree | 716c4f118321cfadbf3c89f375329e44a4039aa3 /lib/oxidized/node.rb | |
parent | f2acb9455edae1bc1c80de28af2362da9da206bf (diff) |
Ignore ssh keys, change input exceptions
Now input ssh has configuration secure which is false by default,
meaning we don't care about changing keys. It breaks ssh security model
but rancid does it too.
Also input models error handling is now mostly moved to node.rb for
centralized handling + logging. With input models only defining which
errors they want to receover from.
Diffstat (limited to 'lib/oxidized/node.rb')
-rw-r--r-- | lib/oxidized/node.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/oxidized/node.rb b/lib/oxidized/node.rb index 0b307b7..31f26a9 100644 --- a/lib/oxidized/node.rb +++ b/lib/oxidized/node.rb @@ -21,7 +21,7 @@ module Oxidized status, config = :fail, nil @input.each do |input| @model.input = input = input.new - if input.connect self + if connect input config = input.get status = :success if config break @@ -32,6 +32,16 @@ module Oxidized [status, config] end + def connect input + rescue_fail = input.class::RescueFail + input.class.superclass::RescueFail + begin + input.connect self + rescue *rescue_fail => err + Log.warn '%s raised %s with msg' % [self.ip, err.class, err.message] + return false + end + end + def serialize h = { :name => @name, |