Sha256: 064c1a6d9ce43ccacfa154db099c5eb0d192d8931cde01cc56b4ee8ef79c050d

Contents?: true

Size: 627 Bytes

Versions: 35

Compression:

Stored size: 627 Bytes

Contents

# frozen_string_literal: true

module Facts
  module Linux
    class Partitions
      FACT_NAME = 'partitions'

      def call_the_resolver
        Facter::ResolvedFact.new(FACT_NAME, partitions)
      end

      def partitions
        parts = Facter::Resolvers::Partitions.resolve(:partitions)
        mountpoints = Facter::Resolvers::Mountpoints.resolve(:mountpoints)
        return parts unless mountpoints

        mountpoints.reverse_each do |mnt|
          next unless parts[mnt[:device]]

          parts[mnt[:device]].merge!(mount: mnt[:path])
        end
        parts.empty? ? nil : parts
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
facter-4.4.0 lib/facter/facts/linux/partitions.rb
facter-4.3.1 lib/facter/facts/linux/partitions.rb
facter-4.3.0 lib/facter/facts/linux/partitions.rb
facter-4.2.14 lib/facter/facts/linux/partitions.rb
facter-4.2.13 lib/facter/facts/linux/partitions.rb
facter-4.2.12 lib/facter/facts/linux/partitions.rb
facter-4.2.11 lib/facter/facts/linux/partitions.rb
facter-4.2.10 lib/facter/facts/linux/partitions.rb
facter-4.2.9 lib/facter/facts/linux/partitions.rb
facter-4.2.8 lib/facter/facts/linux/partitions.rb
facter-4.2.7 lib/facter/facts/linux/partitions.rb
facter-4.2.6 lib/facter/facts/linux/partitions.rb
facter-4.2.5 lib/facter/facts/linux/partitions.rb
facter-4.2.4 lib/facter/facts/linux/partitions.rb
facter-4.2.3 lib/facter/facts/linux/partitions.rb
facter-4.2.2 lib/facter/facts/linux/partitions.rb
facter-4.2.1 lib/facter/facts/linux/partitions.rb
facter-4.2.0 lib/facter/facts/linux/partitions.rb
facter-4.1.1 lib/facter/facts/linux/partitions.rb
facter-4.1.0 lib/facter/facts/linux/partitions.rb