Sha256: c5a698b8fac63d7b88d550d27c3540d02c0d2229bb6f77874aabff3aa268108b

Contents?: true

Size: 623 Bytes

Versions: 7

Compression:

Stored size: 623 Bytes

Contents

# frozen_string_literal: true

module Facts
  module El
    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::Linux::Mountpoints.resolve(:mountpoints)
        return parts unless mountpoints

        mountpoints.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

7 entries across 7 versions & 1 rubygems

Version Path
facter-4.0.20 lib/facts/el/partitions.rb
facter-4.0.19 lib/facts/el/partitions.rb
facter-4.0.18 lib/facts/el/partitions.rb
facter-4.0.17 lib/facts/el/partitions.rb
facter-4.0.16 lib/facts/el/partitions.rb
facter-4.0.15 lib/facts/el/partitions.rb
facter-4.0.14 lib/facts/el/partitions.rb