diff options
author | mh <mh@immerda.ch> | 2015-10-25 14:43:23 +0100 |
---|---|---|
committer | mh <mh@immerda.ch> | 2015-10-25 14:44:25 +0100 |
commit | edd580ab2dc92adcb8291fd17d268cfbb6226c3b (patch) | |
tree | 2c713b514212c71d67ae90d6f31041630941a616 /lib/facter/mountpoints.rb | |
parent | cfff7d115e4cff2a4aa5bcfbd01e7ebe265b7a48 (diff) | |
parent | f215de3de43f141ae71fd124a84003d157da7295 (diff) |
Merge remote-tracking branch 'shared/master'
Diffstat (limited to 'lib/facter/mountpoints.rb')
-rw-r--r-- | lib/facter/mountpoints.rb | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/lib/facter/mountpoints.rb b/lib/facter/mountpoints.rb deleted file mode 100644 index c51e6e6..0000000 --- a/lib/facter/mountpoints.rb +++ /dev/null @@ -1,50 +0,0 @@ -begin - - mountpoints = [] - # we show devices, but we avoid outputing duplicate devices - devices = [] - Facter.add("mountpoints") do - ignorefs = ["NFS", "nfs", "nfs4", "nfsd", "afs", "binfmt_misc", "proc", "smbfs", - "autofs", "iso9660", "ncpfs", "coda", "devpts", "ftpfs", "devfs", - "mfs", "shfs", "sysfs", "cifs", "lustre_lite", "tmpfs", "usbfs", "udf", - "fusectl", "fuse.snapshotfs", "rpc_pipefs"] - begin - require 'filesystem' - rescue Exception => e - confine :kernel => :linux - ENV["PATH"]="/bin:/sbin:/usr/bin:/usr/sbin" - fs_source = nil - if FileTest.exists?("/etc/mtab") - fs_source = "/etc/mtab" - elsif FileTest.exists?("/proc/mounts") - fs_source = "/proc/mounts" - end - - mounts = File.read(fs_source).split("\n") - mounts.each do |mount| - mount = mount.split(" ") - if ((not ignorefs.include?(mount[2])) && (mount[3] !~ /bind/) && (not devices.include?(mount[0])) && (not mountpoints.include?(mount[1]))) - mountpoints.push(mount[1]) - end - devices.push(mount[0]) if not devices.include?(mount[0]) - end - else - FileSystem.mounts.each do |m| - if ((not ignorefs.include?(m.fstype)) && (m.options !~ /bind/) && !devices.include?(mount[0])) - mountpoints.push(m.mount) - end - devices.push(m.mount) if not devices.include?(m.mount) - end - end - setcode do - mountpoints.join(",") - end - end - Facter.add("devices") do - setcode do - devices.join(",") - end - end - -rescue Exception => e -end |