summaryrefslogtreecommitdiff
path: root/lib/facter
diff options
context:
space:
mode:
authorJerome Charaoui <jcharaoui@cmaisonneuve.qc.ca>2015-04-17 15:28:27 +0000
committerJerome Charaoui <jcharaoui@cmaisonneuve.qc.ca>2015-04-17 15:28:27 +0000
commit55c9357a173b787905d99163bc33c137120fa6d7 (patch)
tree36acf6cc1f2be656e53522b725a0e5e6fbb234b1 /lib/facter
parent3c34f3a4f4d862182eee19fbb0b8fbd1e4cf16ed (diff)
parent9a00516e8bd12c69ae2dfb5d1675c19792c1e376 (diff)
Merge branch 'master' into 'master'
Remove unused 'mountpoints' fact. Closes #1 See merge request !3
Diffstat (limited to 'lib/facter')
-rw-r--r--lib/facter/mountpoints.rb52
1 files changed, 0 insertions, 52 deletions
diff --git a/lib/facter/mountpoints.rb b/lib/facter/mountpoints.rb
deleted file mode 100644
index da2f2a9..0000000
--- a/lib/facter/mountpoints.rb
+++ /dev/null
@@ -1,52 +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
- setcode do
- 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
- 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