HEX
Server: Apache
System: Linux sg241.singhost.net 2.6.32-896.16.1.lve1.4.51.el6.x86_64 #1 SMP Wed Jan 17 13:19:23 EST 2018 x86_64
User: honghock (909)
PHP: 8.0.30
Disabled: passthru,system,shell_exec,show_source,exec,popen,proc_open
Upload Files
File: //usr/lib/ruby/site_ruby/1.8/puppet/indirector/facts/couch.rb
require 'puppet/node/facts'
require 'puppet/indirector/couch'
class Puppet::Node::Facts::Couch < Puppet::Indirector::Couch

  desc "DEPRECATED. This terminus will be removed in Puppet 4.0.

    Store facts in CouchDB. This should not be used with the inventory service;
    it is for more obscure custom integrations. If you are wondering whether you
    should use it, you shouldn't; use PuppetDB instead."
  # Return the facts object or nil if there is no document
  def find(request)
    doc = super
    doc ? model.new(doc['_id'], doc['facts']) : nil
  end

  private

  # Facts values are stored to the document's 'facts' attribute. Hostname is
  # stored to 'name'
  #
  def hash_from(request)
    super.merge('facts' => request.instance.values)
  end

  # Facts are stored to the 'node' document.
  def document_type_for(request)
    'node'
  end

  # The id used to store the object in couchdb.
  def id_for(request)
    request.key.to_s
  end

end