class Facter::Resolvers::WinOsDescription
Private Class Methods
post_resolve(fact_name, _options)
click to toggle source
# File lib/facter/resolvers/windows/win_os_description.rb, line 11 def post_resolve(fact_name, _options) @fact_list.fetch(fact_name) { read_from_ole(fact_name) } end
read_from_ole(fact_name)
click to toggle source
# File lib/facter/resolvers/windows/win_os_description.rb, line 15 def read_from_ole(fact_name) win = Facter::Util::Windows::Win32Ole.new op_sys = win.return_first('SELECT ProductType,OtherTypeDescription FROM Win32_OperatingSystem') unless op_sys @log.debug 'WMI query returned no results for Win32_OperatingSystem'\ 'with values ProductType and OtherTypeDescription.' return end @fact_list[:consumerrel] = (op_sys.ProductType == 1) @fact_list[:description] = op_sys.OtherTypeDescription @fact_list[fact_name] end