lib/resolvers/load_averages_resolver.rb in facter-4.0.15 vs lib/resolvers/load_averages_resolver.rb in facter-4.0.16
- old
+ new
@@ -13,12 +13,10 @@
def post_resolve(fact_name)
@fact_list.fetch(fact_name) { read_load_averages_file(fact_name) }
end
def read_load_averages_file(fact_name)
- return unless File.readable?('/proc/loadavg')
-
- output = File.read('/proc/loadavg')
+ output = Util::FileHelper.safe_read('/proc/loadavg')
@fact_list[:load_averages] = {}.tap { |h| h['1m'], h['5m'], h['15m'], = output.split.map(&:to_f) }
@fact_list[fact_name]
end
end