diff options
author | Danilo Sousa <dsgoncalves@uoldiveo.com> | 2016-08-29 16:42:06 -0300 |
---|---|---|
committer | Danilo Sousa <dsgoncalves@uoldiveo.com> | 2016-08-29 16:42:06 -0300 |
commit | 699136c8c3a1a409a2eaa19019ec6df6bb4b61e0 (patch) | |
tree | 10229bd7cf4b49c098a24dd1cf351259f9483b54 /lib/oxidized/output/file.rb | |
parent | 29b972f0a2a11b2ca52cf290f733914914f2f3f8 (diff) |
fix the node variable from `#fetch`. closes #529
in commit `de2a9d1` I changed the `#fetch` method to pass the
`Node` object instead of the node name.
Diffstat (limited to 'lib/oxidized/output/file.rb')
-rw-r--r-- | lib/oxidized/output/file.rb | 10 |
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 |