summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorytti <saku@ytti.fi>2016-08-29 22:46:13 +0300
committerGitHub <noreply@github.com>2016-08-29 22:46:13 +0300
commit5c1173ff1cf130a271267beb1e11a371e6134908 (patch)
tree0961c78ce44c0c7378272614b3fc77805bca51e3
parent5ac5fe876e5fd057574574f95b8f220ba4cd7fa2 (diff)
parent699136c8c3a1a409a2eaa19019ec6df6bb4b61e0 (diff)
Merge pull request #547 from danilopopeye/ds-fix-529
fix the node variable from `#fetch`
-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