lib/facter/resolvers/dmi.rb in facter-4.2.5 vs lib/facter/resolvers/dmi.rb in facter-4.2.6
- old
+ new
@@ -34,9 +34,10 @@
board_serial chassis_asset_tag chassis_type sys_vendor product_name
product_serial product_uuid]
return unless File.directory?('/sys/class/dmi')
file_content = Facter::Util::FileHelper.safe_read("/sys/class/dmi/id/#{fact_name}", nil)
+ .encode('UTF-8', invalid: :replace)
if files.include?(fact_name.to_s) && file_content
file_content = file_content.strip
@fact_list[fact_name] = file_content unless file_content.empty?
chassis_to_name(@fact_list[fact_name]) if fact_name == :chassis_type
end