summaryrefslogtreecommitdiffstats
path: root/lib/puppet/node
diff options
context:
space:
mode:
authorRein Henrichs <rein@puppetlabs.com>2010-06-14 16:40:38 -0700
committertest branch <puppet-dev@googlegroups.com>2010-02-17 06:50:53 -0800
commit432db2593f15de200767ec16c14f433f718a44d9 (patch)
tree934cdcbacb66a702929e270849675a24c59a140d /lib/puppet/node
parent35636e9984f1f9b2c6fae3d1410b4b08b6311693 (diff)
downloadpuppet-432db2593f15de200767ec16c14f433f718a44d9.tar.gz
puppet-432db2593f15de200767ec16c14f433f718a44d9.tar.xz
puppet-432db2593f15de200767ec16c14f433f718a44d9.zip
[#4055] Add CouchDB terminus for facts
Implements an abstract CouchDB terminus and a concrete CouchDB terminus used to store node facts. Node facts are stored in a "node" document as the "facts" attribute. This node document may also be used by other couchdb termini that store node-related information. It is recommended to use a separate document (or documents) to store large data structures like catalogs, linking them to their related node document using embedded ids. This implementation depends on the "couchrest" gem. * Add Puppet.features.couchdb? * Add Puppet[:couchdb_url] setting * Add Puppet::Node::Facts#== for testing * Add PuppetSpec::FIXTURE_DIR for easy access to fixture files * Add CouchDB Terminus * Add Facts::CouchDB terminus * Stores facts inside a "node" document * Use key (hostname) as _id for node document * #find returns nil if document cannot be found * #save finds and updates existing document OR creates new doc [1] * Store facts in "facts" attribute of node document
Diffstat (limited to 'lib/puppet/node')
-rwxr-xr-xlib/puppet/node/facts.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/puppet/node/facts.rb b/lib/puppet/node/facts.rb
index 2b086afea..0b9fc5879 100755
--- a/lib/puppet/node/facts.rb
+++ b/lib/puppet/node/facts.rb
@@ -49,6 +49,11 @@ class Puppet::Node::Facts
end
end
+ def ==(other)
+ return false unless self.name == other.name
+ strip_internal == other.send(:strip_internal)
+ end
+
private
# Add internal data to the facts for storage.