Sha256: 2bc3f536d34168dbacb22253fe10cdb58dae15c6dff23d4c53be01ff54137d91
Contents?: true
Size: 870 Bytes
Versions: 7
Compression:
Stored size: 870 Bytes
Contents
# frozen_string_literal: true module Facter module Resolvers class Architecture < BaseResolver # :architecture @fact_list ||= {} class << self private def post_resolve(fact_name) @fact_list.fetch(fact_name) { read_architecture(fact_name) } end def read_architecture(fact_name) require_relative 'utils/odm_query' odmquery = ODMQuery.new odmquery .equals('name', 'proc0') .equals('attribute', 'type') result = odmquery.execute return unless result result.each_line do |line| if line.include?('value') @fact_list[:architecture] = line.split('=')[1].strip.delete('\"') break end end @fact_list[fact_name] end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems