Sha256: f268ee0da8763d820e86c40ea19112b273a63566d0672fe9a9eb4539687837c7

Contents?: true

Size: 907 Bytes

Versions: 2

Compression:

Stored size: 907 Bytes

Contents

# frozen_string_literal: true

module Facter
  module Resolvers
    module Linux
      class Filesystems < BaseResolver
        # :systems
        @semaphore = Mutex.new
        @fact_list ||= {}
        @log = Facter::Log.new(self)
        class << self
          private

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

          def read_filesystems(fact_name)
            output = Util::FileHelper.safe_readlines('/proc/filesystems', nil)
            return unless output

            filesystems = []
            output.each do |line|
              tokens = line.split(' ')
              filesystems << tokens if tokens.size == 1 && tokens.first != 'fuseblk'
            end
            @fact_list[:systems] = filesystems.sort.join(',')
            @fact_list[fact_name]
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
facter-4.0.36 lib/facter/resolvers/filesystems_resolver.rb
facter-4.0.35 lib/facter/resolvers/filesystems_resolver.rb