Skip to content
This repository has been archived by the owner on Jun 19, 2020. It is now read-only.

Commit

Permalink
Revert "(FACT-2555) Force mount-point data to UTF-8 as it might be AS…
Browse files Browse the repository at this point in the history
…CI in some cases (e.g. when time machine is running on macOS)"

This reverts commit 8cdf10d.
  • Loading branch information
Bogdan Irimie committed Apr 28, 2020
1 parent 35b7690 commit 4fed55b
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions lib/resolvers/macosx/mountpoints_resolver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ def post_resolve(fact_name)
def read_mounts # rubocop:disable Metrics/AbcSize
mounts = {}
FilesystemHelper.read_mountpoints.each do |fs|
device = fs.name.force_encoding('UTF-8')
filesystem = fs.mount_type.force_encoding('UTF-8')
path = fs.mount_point.force_encoding('UTF-8')
options = fs.options.force_encoding('UTF-8').split(',').map(&:strip).map { |o| o == 'rootfs' ? 'root' : o }
device = fs.name
filesystem = fs.mount_type
path = fs.mount_point
options = fs.options.split(',').map(&:strip).map { |o| o == 'rootfs' ? 'root' : o }

next if path =~ %r{^/(proc|sys)} && filesystem != 'tmpfs' || filesystem == 'autofs'

Expand All @@ -46,13 +46,13 @@ def read_stats(path)
end

{
size_bytes: 2, #size_bytes,
used_bytes: 2, #used_bytes,
available_bytes: 2, #available_bytes,
capacity: 2, #FilesystemHelper.compute_capacity(used_bytes, size_bytes),
size: 2,#Facter::FactsUtils::UnitConverter.bytes_to_human_readable(size_bytes),
available: 2, #Facter::FactsUtils::UnitConverter.bytes_to_human_readable(available_bytes),
used: 2 # Facter::FactsUtils::UnitConverter.bytes_to_human_readable(used_bytes)
size_bytes: size_bytes,
used_bytes: used_bytes,
available_bytes: available_bytes,
capacity: FilesystemHelper.compute_capacity(used_bytes, size_bytes),
size: Facter::FactsUtils::UnitConverter.bytes_to_human_readable(size_bytes),
available: Facter::FactsUtils::UnitConverter.bytes_to_human_readable(available_bytes),
used: Facter::FactsUtils::UnitConverter.bytes_to_human_readable(used_bytes)
}
end
end
Expand Down

0 comments on commit 4fed55b

Please sign in to comment.