summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authornopedial <shafez@ike-2.local>2013-10-23 23:20:25 +0200
committernopedial <shafez@ike-2.local>2013-10-23 23:20:25 +0200
commitb8150eae04924f2c45cdb0c4b3f60902c8ae3d96 (patch)
tree896750beae91bb6fd7305c7d22afd85dc1481c15 /lib
parentc7d482c514e3d3917cbeb9a95ea8babf22116fe3 (diff)
finalize fetch API call
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