summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/oxidized/output/file.rb10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/oxidized/output/file.rb b/lib/oxidized/output/file.rb
index 6e1a231..2ea2302 100644
--- a/lib/oxidized/output/file.rb
+++ b/lib/oxidized/output/file.rb
@@ -31,15 +31,11 @@ class OxFile < Output
if group != 0 # group is explicitly defined by user
IO.readlines File.join(cfg_dir, group, node)
else
- if File.exists?("#{cfg_dir}/#{node}") # node configuration file is stored on base directory
+ if File.exists? File.join(cfg_dir, node) # node configuration file is stored on base directory
IO.readlines File.join(cfg_dir, node)
else
- file =
- if file
- open(file, 'r').readlines
- else
- "not found."
- end
+ path = Dir.glob File.join(cfg_dir, '**', node) # fetch node in all groups
+ open(path[0], 'r').readlines
end
end
end