Sha256: 312bbc2137be82e970e5b8eca797f4b3cabeb70b2271403b014a5cff8cc1941a

Contents?: true

Size: 958 Bytes

Versions: 50

Compression:

Stored size: 958 Bytes

Contents

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

Version data entries

50 entries across 50 versions & 2 rubygems

Version Path
puppet-retrospec-0.12.2 vendor/gems/puppet-3.7.3/lib/puppet/indirector/facts/couch.rb
puppet-3.8.7 lib/puppet/indirector/facts/couch.rb
puppet-3.8.7-x86-mingw32 lib/puppet/indirector/facts/couch.rb
puppet-3.8.7-x64-mingw32 lib/puppet/indirector/facts/couch.rb
puppet-3.8.6 lib/puppet/indirector/facts/couch.rb
puppet-3.8.6-x86-mingw32 lib/puppet/indirector/facts/couch.rb
puppet-retrospec-0.12.1 vendor/gems/puppet-3.7.3/lib/puppet/indirector/facts/couch.rb
puppet-3.8.6-x64-mingw32 lib/puppet/indirector/facts/couch.rb
puppet-retrospec-0.12.0 vendor/gems/puppet-3.7.3/lib/puppet/indirector/facts/couch.rb
puppet-3.8.5 lib/puppet/indirector/facts/couch.rb
puppet-3.8.5-x86-mingw32 lib/puppet/indirector/facts/couch.rb
puppet-3.8.5-x64-mingw32 lib/puppet/indirector/facts/couch.rb
puppet-3.8.4 lib/puppet/indirector/facts/couch.rb
puppet-3.8.4-x86-mingw32 lib/puppet/indirector/facts/couch.rb
puppet-3.8.4-x64-mingw32 lib/puppet/indirector/facts/couch.rb
puppet-retrospec-0.11.0 vendor/gems/puppet-3.7.3/lib/puppet/indirector/facts/couch.rb
puppet-retrospec-0.10.0 vendor/gems/puppet-3.7.3/lib/puppet/indirector/facts/couch.rb
puppet-retrospec-0.9.1 vendor/gems/puppet-3.7.3/lib/puppet/indirector/facts/couch.rb
puppet-retrospec-0.9.0 vendor/gems/puppet-3.7.3/lib/puppet/indirector/facts/couch.rb
puppet-retrospec-0.8.1 vendor/gems/puppet-3.7.3/lib/puppet/indirector/facts/couch.rb