summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-03-16 17:58:16 -0500
committerLuke Kanies <luke@madstop.com>2008-03-16 17:58:16 -0500
commit1dc0e24a4ff565486c00c542f78ab45e23a64ef9 (patch)
tree96a682e0026e5c0535a345ab22578c3a6dda7fcb
parent4a45a1da0653f18df6bd41b009a30387df697909 (diff)
downloadpuppet-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--CHANGELOG4
-rw-r--r--lib/puppet/indirector/node/ldap.rb4
-rwxr-xr-xspec/unit/indirector/node/ldap.rb7
3 files changed, 15 insertions, 0 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 99b5124f2..e17c1737a 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -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