Sha256: 3884b87848905f7065161518744e347d5ee69100cc51584b927488fc63d897ef

Contents?: true

Size: 682 Bytes

Versions: 4

Compression:

Stored size: 682 Bytes

Contents

# frozen_string_literal: true

module Facter
  module Resolvers
    module Aix
      class Nim < BaseResolver
        init_resolver

        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

4 entries across 4 versions & 1 rubygems

Version Path
facter-4.0.49 lib/facter/resolvers/aix/nim.rb
facter-4.0.48 lib/facter/resolvers/aix/nim.rb
facter-4.0.47 lib/facter/resolvers/aix/nim.rb
facter-4.0.46 lib/facter/resolvers/aix/nim.rb