summaryrefslogtreecommitdiff
path: root/lib/oxidized/node.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/oxidized/node.rb')
-rw-r--r--lib/oxidized/node.rb12
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,