summaryrefslogtreecommitdiffstats
path: root/lib/puppet/node
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-04-10 14:44:14 -0500
committerLuke Kanies <luke@madstop.com>2008-04-10 14:44:14 -0500
commit738889ba027b894867209d5175c716f9a2cc54c6 (patch)
tree77e46799379d1d5654b24b0dfefdcaff2482491d /lib/puppet/node
parentf285f1aab525a2585532fda0b15b7fd28e994491 (diff)
downloadpuppet-738889ba027b894867209d5175c716f9a2cc54c6.tar.gz
puppet-738889ba027b894867209d5175c716f9a2cc54c6.tar.xz
puppet-738889ba027b894867209d5175c716f9a2cc54c6.zip
Fixing the expire method (it wasn't using a request
internally), and fixing the Facts class so it auto-expires any associated cached nodes when facts are saved.
Diffstat (limited to 'lib/puppet/node')
-rwxr-xr-xlib/puppet/node/facts.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/puppet/node/facts.rb b/lib/puppet/node/facts.rb
index c60be3fcf..8ee90b4ac 100755
--- a/lib/puppet/node/facts.rb
+++ b/lib/puppet/node/facts.rb
@@ -8,8 +8,16 @@ class Puppet::Node::Facts
# the node sources.
extend Puppet::Indirector
+ # We want to expire any cached nodes if the facts are saved.
+ module NodeExpirer
+ def save(instance, *args)
+ Puppet::Node.expire(instance.name)
+ super
+ end
+ end
+
# Use the node source as the indirection terminus.
- indirects :facts, :terminus_class => :facter
+ indirects :facts, :terminus_class => :facter, :extend => NodeExpirer
attr_accessor :name, :values