diff options
| author | Saku Ytti <saku@ytti.fi> | 2016-10-26 22:08:19 +0300 | 
|---|---|---|
| committer | Saku Ytti <saku@ytti.fi> | 2016-10-26 22:08:19 +0300 | 
| commit | 9ce9133dbf4589786329d5dad239f80882ea07ea (patch) | |
| tree | 8637da7a855e07d3b6b85bec1c442f2616236b73 /lib/oxidized | |
| parent | 449522554473f4b9a261ec06ee6961defb30f7bb (diff) | |
return nil if we can't find file
unsure if we really should, or just raise the error and let consumer of
fetch decide what to do with the error
Diffstat (limited to 'lib/oxidized')
| -rw-r--r-- | lib/oxidized/output/file.rb | 3 | 
1 files changed, 2 insertions, 1 deletions
| diff --git a/lib/oxidized/output/file.rb b/lib/oxidized/output/file.rb index 78db1d5..5327a80 100644 --- a/lib/oxidized/output/file.rb +++ b/lib/oxidized/output/file.rb @@ -39,10 +39,11 @@ class OxidizedFile < Output          File.read File.join(cfg_dir, node_name)        else          path = Dir.glob(File.join(cfg_dir, '**', node_name)).first # fetch node in all groups -        return nil if not path          File.read path        end      end +  rescue Errno::ENOENT +    return nil    end    def version node, group | 
