Sha256: a869961606b5321253888b3a61442744fc4819887927ed2b4df88b1228bff53a

Contents?: true

Size: 717 Bytes

Versions: 14

Compression:

Stored size: 717 Bytes

Contents

# frozen_string_literal: true

module Facter
  module Resolvers
    module Aix
      class Nim < BaseResolver
        @semaphore = Mutex.new
        @fact_list ||= {}

        class << self
          private

          def post_resolve(fact_name)
            @fact_list.fetch(fact_name) { read_niminfo(fact_name) }
          end

          def read_niminfo(fact_name)
            output = Facter::Util::FileHelper.safe_read('/etc/niminfo', nil)

            return unless output

            type = /NIM_CONFIGURATION=(.*)/.match(output)
            @fact_list[:type] = type[1] if type[1] && /master|standalone/.match?(type[1])

            @fact_list[fact_name]
          end
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
facter-4.0.36 lib/facter/resolvers/aix/nim.rb
facter-4.0.35 lib/facter/resolvers/aix/nim.rb
facter-4.0.34 lib/facter/resolvers/aix/nim.rb
facter-4.0.33 lib/facter/resolvers/aix/nim.rb
facter-4.0.32 lib/facter/resolvers/aix/nim.rb
facter-4.0.31 lib/facter/resolvers/aix/nim.rb
facter-4.0.30 lib/facter/resolvers/aix/nim.rb
facter-4.0.29 lib/resolvers/aix/nim.rb
facter-4.0.28 lib/resolvers/aix/nim.rb
facter-4.0.26 lib/resolvers/aix/nim.rb
facter-4.0.25 lib/resolvers/aix/nim.rb
facter-4.0.24 lib/resolvers/aix/nim.rb
facter-4.0.23 lib/resolvers/aix/nim.rb
facter-4.0.22 lib/resolvers/aix/nim.rb