Sha256: ccb404299d5328fd04ccfe205448fc55678037bbdbdf16784d713e6bfca19c41

Contents?: true

Size: 858 Bytes

Versions: 13

Compression:

Stored size: 858 Bytes

Contents

# frozen_string_literal: true

module Facter
  module Resolvers
    module Solaris
      class ZFS < BaseResolver
        @log = Facter::Log.new(self)
        @semaphore = Mutex.new
        @fact_list ||= {}
        class << self
          private

          def post_resolve(fact_name)
            @fact_list.fetch(fact_name) { zfs_fact(fact_name) }
          end

          def zfs_fact(fact_name)
            build_zfs_facts
            @fact_list[fact_name]
          end

          def build_zfs_facts
            output, _status = Open3.capture2('zfs upgrade -v')
            features_list = output.scan(/^\s+(\d+)/).flatten

            return if features_list.empty?

            @fact_list[:zfs_featurenumbers] = features_list.join(',')
            @fact_list[:zfs_version] = features_list.last
          end
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
facter-4.0.20 lib/resolvers/solaris/zfs_resolver.rb
facter-4.0.19 lib/resolvers/solaris/zfs_resolver.rb
facter-4.0.18 lib/resolvers/solaris/zfs_resolver.rb
facter-4.0.17 lib/resolvers/solaris/zfs_resolver.rb
facter-4.0.16 lib/resolvers/solaris/zfs_resolver.rb
facter-4.0.15 lib/resolvers/solaris/zfs_resolver.rb
facter-4.0.14 lib/resolvers/solaris/zfs_resolver.rb
facter-4.0.13 lib/resolvers/solaris/zfs_resolver.rb
facter-4.0.12 lib/resolvers/solaris/zfs_resolver.rb
facter-4.0.11 lib/resolvers/solaris/zfs_resolver.rb
facter-4.0.10.pre lib/resolvers/solaris/zfs_resolver.rb
facter-4.0.9.pre lib/resolvers/solaris/zfs_resolver.rb
facter-4.0.8.pre lib/resolvers/solaris/zfs_resolver.rb