Anons79 Mini Shell

Directory : /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/facts/
Upload File :
Current File : //opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/facts/json.rb

require 'puppet/node/facts'
require 'puppet/indirector/json'
require 'puppet/indirector/fact_search'

class Puppet::Node::Facts::Json < Puppet::Indirector::JSON
  desc "Store client facts as flat files, serialized using JSON, or
    return deserialized facts from disk."

  include Puppet::Indirector::FactSearch
  
  def search(request)
    node_names = []
    Dir.glob(json_dir_path).each do |file|
      facts = load_json_from_file(file, '')
      if facts && node_matches?(facts, request.options)
        node_names << facts.name
      end
    end
    node_names
  end

  private

  def json_dir_path
    self.path("*")
  end
end

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]