Sha256: bc51fd074d1698ad092a35838e8279d4154f9824555f2dce806349708fc57070
Contents?: true
Size: 933 Bytes
Versions: 29
Compression:
Stored size: 933 Bytes
Contents
# frozen_string_literal: true module Facter module Resolvers class WinOsDescription < BaseResolver @log = Facter::Log.new(self) @semaphore = Mutex.new @fact_list ||= {} class << self private def post_resolve(fact_name) @fact_list.fetch(fact_name) { read_from_ole(fact_name) } end def read_from_ole(fact_name) win = 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 end end end end
Version data entries
29 entries across 29 versions & 1 rubygems