lib/facter/resolvers/mountpoints_resolver.rb in facter-4.0.42 vs lib/facter/resolvers/mountpoints_resolver.rb in facter-4.0.43

- old
+ new

@@ -8,11 +8,11 @@ @log = Facter::Log.new(self) class << self private def post_resolve(fact_name) - @fact_list.fetch(fact_name) { read_mounts } + @fact_list.fetch(fact_name) { read_mounts(fact_name) } end def root_device cmdline = Util::FileHelper.safe_read('/proc/cmdline') match = cmdline.match(/root=([^\s]+)/) @@ -24,11 +24,12 @@ # This is done because not all systems symlink /dev/root device = root_device if device == '/dev/root' device end - def read_mounts # rubocop:disable Metrics/AbcSize + # rubocop:disable Metrics/MethodLength, Metrics/AbcSize + def read_mounts(fact_name) mounts = [] FilesystemHelper.read_mountpoints.each do |fs| device = compute_device(fs.name) filesystem = fs.mount_type path = fs.mount_point @@ -50,10 +51,12 @@ mounts << Hash[FilesystemHelper::MOUNT_KEYS.zip(FilesystemHelper::MOUNT_KEYS .map { |v| binding.local_variable_get(v) })] end @fact_list[:mountpoints] = mounts + @fact_list[fact_name] end + # rubocop:enable Metrics/MethodLength, Metrics/AbcSize end end end end