From a6431e29cf72e28fd151374bacea1a3b2c61c396 Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Fri, 16 May 2014 15:47:43 +0300 Subject: don't store error Node raised We may need this in future, but as we don't need this in oxidized-script now after all, I don't want something to be implemented just-in-case --- lib/oxidized/node.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/oxidized/node.rb b/lib/oxidized/node.rb index 456168b..0f4c525 100644 --- a/lib/oxidized/node.rb +++ b/lib/oxidized/node.rb @@ -4,7 +4,7 @@ module Oxidized class MethodNotFound < OxidizedError; end class ModelNotFound < OxidizedError; end class Node - attr_reader :name, :ip, :model, :input, :output, :group, :auth, :prompt, :vars, :last, :error + attr_reader :name, :ip, :model, :input, :output, :group, :auth, :prompt, :vars, :last attr_accessor :running, :user, :msg, :from, :stats alias :running? :running def initialize opt @@ -24,7 +24,7 @@ module Oxidized end def run - status, config, @error = :fail, nil, nil + status, config = :fail, nil @input.each do |input| @model.input = input = input.new if config=run_input(input) @@ -52,7 +52,6 @@ module Oxidized input.get end rescue *rescue_fail.keys => err - @error = err resc = '' if not level = rescue_fail[err.class] resc = err.class.ancestors.find{|e|rescue_fail.keys.include? e} @@ -62,7 +61,6 @@ module Oxidized Log.send(level, '%s raised %s%s with msg "%s"' % [self.ip, err.class, resc, err.message]) return false rescue => err - @error = err file = Oxidized::Config::Crash + '.' + self.ip.to_s open file, 'w' do |fh| fh.puts Time.now.utc -- cgit v1.2.1