summaryrefslogtreecommitdiff
path: root/lib/oxidized/output/file.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/oxidized/output/file.rb')
-rw-r--r--lib/oxidized/output/file.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/oxidized/output/file.rb b/lib/oxidized/output/file.rb
index 0b64447..851e4c5 100644
--- a/lib/oxidized/output/file.rb
+++ b/lib/oxidized/output/file.rb
@@ -29,13 +29,15 @@ class OxidizedFile < Output
def fetch node, group
cfg_dir = File.expand_path @cfg.directory
+ node_name = node.name
+
if group # group is explicitly defined by user
- IO.readlines File.join(cfg_dir, group, node)
+ IO.readlines File.join(cfg_dir, group, node_name)
else
- if File.exists? File.join(cfg_dir, node) # node configuration file is stored on base directory
- IO.readlines File.join(cfg_dir, node)
+ if File.exists? File.join(cfg_dir, node_name) # node configuration file is stored on base directory
+ IO.readlines File.join(cfg_dir, node_name)
else
- path = Dir.glob File.join(cfg_dir, '**', node) # fetch node in all groups
+ path = Dir.glob File.join(cfg_dir, '**', node_name) # fetch node in all groups
return nil if path[0].nil?
open(path[0], 'r').readlines
end