lib/facter/framework/config/config_reader.rb in facter-4.0.49 vs lib/facter/framework/config/config_reader.rb in facter-4.0.50

- old
+ new

@@ -31,12 +31,19 @@ @conf['fact-groups'] end def refresh_config(config_path) @conf = File.readable?(config_path) ? Hocon.load(config_path) : {} + rescue StandardError => e + log.warn("Facter failed to read config file #{config_path} with the following error: #{e.message}") + @conf = {} end private + + def log + @log ||= Log.new(self) + end def default_path os = OsDetector.instance.identifier windows_path = File.join('C:', 'ProgramData', 'PuppetLabs', 'facter', 'etc', 'facter.conf')