Sha256: 26de4ceed38649cbe60841163bc5e23d5dd0ebba578d8593a827d485d205c63c

Contents?: true

Size: 822 Bytes

Versions: 3

Compression:

Stored size: 822 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 = File.read('/proc/filesystems')
            filesystems = []
            output.each_line do |line|
              tokens = line.split(' ')
              filesystems << tokens if tokens.size == 1
            end
            @fact_list[:systems] = filesystems.sort.join(',')
            @fact_list[fact_name]
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
facter-4.0.9.pre lib/resolvers/filesystems_resolver.rb
facter-4.0.8.pre lib/resolvers/filesystems_resolver.rb
facter-4.0.7.pre lib/resolvers/filesystems_resolver.rb