From 9ce9133dbf4589786329d5dad239f80882ea07ea Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Wed, 26 Oct 2016 22:08:19 +0300 Subject: 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 --- lib/oxidized/output/file.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/oxidized/output') 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 -- cgit v1.2.1