diff options
author | Luke Kanies <luke@madstop.com> | 2008-03-16 17:58:16 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-03-16 17:58:16 -0500 |
commit | 1dc0e24a4ff565486c00c542f78ab45e23a64ef9 (patch) | |
tree | 96a682e0026e5c0535a345ab22578c3a6dda7fcb | |
parent | 4a45a1da0653f18df6bd41b009a30387df697909 (diff) | |
download | puppet-1dc0e24a4ff565486c00c542f78ab45e23a64ef9.tar.gz puppet-1dc0e24a4ff565486c00c542f78ab45e23a64ef9.tar.xz puppet-1dc0e24a4ff565486c00c542f78ab45e23a64ef9.zip |
Modified the ldap node terminus to also use the facts version
as the version for a node, which should similarly encourage the
use of the yaml cache. (Related to #1130)
-rw-r--r-- | CHANGELOG | 4 | ||||
-rw-r--r-- | lib/puppet/indirector/node/ldap.rb | 4 | ||||
-rwxr-xr-x | spec/unit/indirector/node/ldap.rb | 7 |
3 files changed, 15 insertions, 0 deletions
@@ -1,3 +1,7 @@ + Modified the ldap node terminus to also use the facts version + as the version for a node, which should similarly encourage the + use of the yaml cache. (Related to #1130) + Caching node information in yaml (I figured caching in memory will cause ever-larger memory growth), and changing the external node terminus to use the version of the facts as their version. This diff --git a/lib/puppet/indirector/node/ldap.rb b/lib/puppet/indirector/node/ldap.rb index 9320f3ba1..8537e1cf3 100644 --- a/lib/puppet/indirector/node/ldap.rb +++ b/lib/puppet/indirector/node/ldap.rb @@ -122,4 +122,8 @@ class Puppet::Node::Ldap < Puppet::Indirector::Ldap end filter end + + def version(name) + Puppet::Node::Facts.version(name) + end end diff --git a/spec/unit/indirector/node/ldap.rb b/spec/unit/indirector/node/ldap.rb index 2a4f240ed..34456703d 100755 --- a/spec/unit/indirector/node/ldap.rb +++ b/spec/unit/indirector/node/ldap.rb @@ -5,6 +5,13 @@ require File.dirname(__FILE__) + '/../../../spec_helper' require 'puppet/indirector/node/ldap' describe Puppet::Node::Ldap do + it "should use the version of the facts as its version" do + @searcher = Puppet::Node::Ldap.new + version = mock 'version' + Puppet::Node::Facts.expects(:version).with("me").returns version + @searcher.version("me").should equal(version) + end + describe "when searching for nodes" do before :each do @searcher = Puppet::Node::Ldap.new |