Sha256: b4c849732ea6c88278d2601f896759b70128ce52db926e1ead1896c080e2440b

Contents?: true

Size: 1.22 KB

Versions: 22

Compression:

Stored size: 1.22 KB

Contents

#
# filesystems.rb
#
# This fact provides an alphabetic list of usable file systems that can
# be used for block devices like hard drives, media cards and so on ...
#
Facter.add('filesystems') do
  confine :kernel => :linux
  setcode do
    # fuseblk can't be created and arguably isn't usable here. If you feel this
    # doesn't match your use-case please raise a bug.
    exclude = %w(fuseblk)

    # Make regular expression form our patterns ...
    exclude = Regexp.union(*exclude.collect { |i| Regexp.new(i) })

    # We utilise rely on "cat" for reading values from entries under "/proc".
    # This is due to some problems with IO#read in Ruby and reading content of
    # the "proc" file system that was reported more than once in the past ...
    file_systems = []
    Facter::Core::Execution.exec('cat /proc/filesystems 2> /dev/null').each_line do |line|
      # Remove bloat ...
      line.strip!

      # Line of interest should not start with "nodev" ...
      next if line.empty? or line.match(/^nodev/)

      # We have something, so let us apply our device type filter ...
      next if line.match(exclude)

      file_systems << line
    end
    file_systems.sort.join(',')
  end
end

# vim: set ts=2 sw=2 et :
# encoding: utf-8

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
facter-2.1.0 lib/facter/filesystems.rb
facter-2.1.0-x86-mingw32 lib/facter/filesystems.rb
facter-2.1.0-x64-mingw32 lib/facter/filesystems.rb
facter-2.1.0-universal-darwin lib/facter/filesystems.rb
facter-2.0.2 lib/facter/filesystems.rb
facter-2.0.2-x86-mingw32 lib/facter/filesystems.rb
facter-2.0.2-universal-darwin lib/facter/filesystems.rb
facter-2.0.1 lib/facter/filesystems.rb
facter-2.0.1-x86-mingw32 lib/facter/filesystems.rb
facter-2.0.1-universal-darwin lib/facter/filesystems.rb
facter-2.0.1.rc4 lib/facter/filesystems.rb
facter-2.0.1.rc4-x86-mingw32 lib/facter/filesystems.rb
facter-2.0.1.rc4-universal-darwin lib/facter/filesystems.rb
facter-2.0.1.rc3 lib/facter/filesystems.rb
facter-2.0.1.rc3-x86-mingw32 lib/facter/filesystems.rb
facter-2.0.1.rc3-universal-darwin lib/facter/filesystems.rb
facter-2.0.1.rc2 lib/facter/filesystems.rb
facter-2.0.1.rc2-x86-mingw32 lib/facter/filesystems.rb
facter-2.0.1.rc2-universal-darwin lib/facter/filesystems.rb
facter-2.0.1.rc1 lib/facter/filesystems.rb