summaryrefslogtreecommitdiff
path: root/lib/oxidized/nodes.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/oxidized/nodes.rb')
-rw-r--r--lib/oxidized/nodes.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/oxidized/nodes.rb b/lib/oxidized/nodes.rb
index 3e0869a..c0ade54 100644
--- a/lib/oxidized/nodes.rb
+++ b/lib/oxidized/nodes.rb
@@ -16,6 +16,7 @@ module Oxidized
nodes.each do |node|
# we want to load specific node(s), not all of them
next unless node_want? node_want, node
+
begin
_node = Node.new node
new.push _node
@@ -32,6 +33,7 @@ module Oxidized
def node_want? node_want, node
return true unless node_want
+
node_want_ip = (IPAddr.new(node_want) rescue false)
name_is_ip = (IPAddr.new(node[:name]) rescue false)
if name_is_ip and node_want_ip == node[:name]
@@ -173,6 +175,7 @@ module Oxidized
node = find { |n| n.name == node_name }
output = node.output.new
raise Oxidized::NotSupported unless output.respond_to? :fetch
+
yield node, output
end
end