lib/facter/resolvers/macosx/mountpoints.rb in facter-4.0.52 vs lib/facter/resolvers/macosx/mountpoints.rb in facter-4.1.0
- old
+ new
@@ -19,11 +19,11 @@
Facter::Util::Resolvers::FilesystemHelper.read_mountpoints.each do |fs|
device = fs.name
filesystem = fs.mount_type
path = fs.mount_point
- options = fs.options.split(',').map(&:strip).map { |o| o == 'rootfs' ? 'root' : o }
+ options = read_options(fs.options)
mounts[path] = read_stats(path).tap do |hash|
hash[:device] = device
hash[:filesystem] = filesystem
hash[:options] = options if options.any?
@@ -50,9 +50,22 @@
capacity: Facter::Util::Resolvers::FilesystemHelper.compute_capacity(used_bytes, size_bytes),
size: Facter::Util::Facts::UnitConverter.bytes_to_human_readable(size_bytes),
available: Facter::Util::Facts::UnitConverter.bytes_to_human_readable(available_bytes),
used: Facter::Util::Facts::UnitConverter.bytes_to_human_readable(used_bytes)
}
+ end
+
+ def read_options(options)
+ options_map = {
+ 'read-only' => 'readonly',
+ 'asynchronous' => 'async',
+ 'synchronous' => 'noasync',
+ 'quotas' => 'quota',
+ 'rootfs' => 'root',
+ 'defwrite' => 'deferwrites'
+ }
+
+ options.split(',').map(&:strip).map { |o| options_map.key?(o) ? options_map[o] : o }
end
end
end
end
end