From f2da63369fcb754e3715091cc4fd2f93db42106e Mon Sep 17 00:00:00 2001 From: Elvin Efendi Date: Tue, 27 Oct 2015 14:49:52 -0400 Subject: better test framework, more specs and Travis CI --- lib/oxidized/nodes.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/oxidized/nodes.rb') diff --git a/lib/oxidized/nodes.rb b/lib/oxidized/nodes.rb index cb2ce7b..f0c5d56 100644 --- a/lib/oxidized/nodes.rb +++ b/lib/oxidized/nodes.rb @@ -9,7 +9,7 @@ module Oxidized def load node_want=nil with_lock do new = [] - @source = CFG.source.default + @source = Oxidized.config.source.default Oxidized.mgr.add_source @source Oxidized.mgr.source[@source].new.load.each do |node| # we want to load specific node(s), not all of them -- cgit v1.2.1 From 1c4f886e883f947b649613a21955929fa6d7e94c Mon Sep 17 00:00:00 2001 From: Elvin Efendi Date: Wed, 9 Dec 2015 23:43:32 -0500 Subject: refactor and fix bugs introduced with new changes --- lib/oxidized/nodes.rb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'lib/oxidized/nodes.rb') diff --git a/lib/oxidized/nodes.rb b/lib/oxidized/nodes.rb index f0c5d56..0c02d7a 100644 --- a/lib/oxidized/nodes.rb +++ b/lib/oxidized/nodes.rb @@ -1,8 +1,8 @@ module Oxidized - require 'ipaddr' - require 'oxidized/node' - class Oxidized::NotSupported < OxidizedError; end - class Oxidized::NodeNotFound < OxidizedError; end + require 'ipaddr' + require 'oxidized/node' + class Oxidized::NotSupported < OxidizedError; end + class Oxidized::NodeNotFound < OxidizedError; end class Nodes < Array attr_accessor :source alias :put :unshift @@ -18,13 +18,13 @@ module Oxidized _node = Node.new node new.push _node rescue ModelNotFound => err - Log.error "node %s raised %s with message '%s'" % [node, err.class, err.message] + Oxidized.logger.error "node %s raised %s with message '%s'" % [node, err.class, err.message] rescue Resolv::ResolvError => err - Log.error "node %s is not resolvable, raised %s with message '%s'" % [node, err.class, err.message] + Oxidized.logger.error "node %s is not resolvable, raised %s with message '%s'" % [node, err.class, err.message] end end size == 0 ? replace(new) : update_nodes(new) - Log.info "Loaded #{size} nodes" + Oxidized.logger.info "Loaded #{size} nodes" end end @@ -148,9 +148,9 @@ module Oxidized end end end - + public - + def version node, group with_lock do i = find_node_index node @@ -159,7 +159,7 @@ module Oxidized output.version node, group end end - + def get_version node, group, oid with_lock do i = find_node_index node @@ -168,7 +168,7 @@ module Oxidized output.get_version node, group, oid end end - + def get_diff node, group, oid1, oid2 with_lock do i = find_node_index node -- cgit v1.2.1