Sha256: b64cde2505449fabee9386694a5fd3f40d3aee17d5b08d777ce57bc28d7a1283

Contents?: true

Size: 899 Bytes

Versions: 29

Compression:

Stored size: 899 Bytes

Contents

# frozen_string_literal: true

module Facter
  module Resolvers
    class Architecture < BaseResolver
      # :architecture
      @semaphore = Mutex.new
      @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

29 entries across 29 versions & 1 rubygems

Version Path
facter-4.0.36 lib/facter/resolvers/aix/architecture_resolver.rb
facter-4.0.35 lib/facter/resolvers/aix/architecture_resolver.rb
facter-4.0.34 lib/facter/resolvers/aix/architecture_resolver.rb
facter-4.0.33 lib/facter/resolvers/aix/architecture_resolver.rb
facter-4.0.32 lib/facter/resolvers/aix/architecture_resolver.rb
facter-4.0.31 lib/facter/resolvers/aix/architecture_resolver.rb
facter-4.0.30 lib/facter/resolvers/aix/architecture_resolver.rb
facter-4.0.29 lib/resolvers/aix/architecture_resolver.rb
facter-4.0.28 lib/resolvers/aix/architecture_resolver.rb
facter-4.0.26 lib/resolvers/aix/architecture_resolver.rb
facter-4.0.25 lib/resolvers/aix/architecture_resolver.rb
facter-4.0.24 lib/resolvers/aix/architecture_resolver.rb
facter-4.0.23 lib/resolvers/aix/architecture_resolver.rb
facter-4.0.22 lib/resolvers/aix/architecture_resolver.rb
facter-4.0.21 lib/resolvers/aix/architecture_resolver.rb
facter-4.0.20 lib/resolvers/aix/architecture_resolver.rb
facter-4.0.19 lib/resolvers/aix/architecture_resolver.rb
facter-4.0.18 lib/resolvers/aix/architecture_resolver.rb
facter-4.0.17 lib/resolvers/aix/architecture_resolver.rb
facter-4.0.16 lib/resolvers/aix/architecture_resolver.rb