summaryrefslogtreecommitdiffstats
path: root/lib/puppet/node
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-11-11 13:12:21 -0800
committerLuke Kanies <luke@madstop.com>2008-11-11 13:12:21 -0800
commit0ecbf79faf8e69efda96f8611837cd1c395f7a7c (patch)
tree4fe918d384da032b797986c49f008548ce4e4795 /lib/puppet/node
parent29b97943e7efaad3cb3f8e7b82004c067d3fbf82 (diff)
downloadpuppet-0ecbf79faf8e69efda96f8611837cd1c395f7a7c.tar.gz
puppet-0ecbf79faf8e69efda96f8611837cd1c395f7a7c.tar.xz
puppet-0ecbf79faf8e69efda96f8611837cd1c395f7a7c.zip
Adding cached attribute support to resources.
The Catalog is the expirer, which means that a resource with no catalog will not cache data. Also switching files to use a cached attribute for its stat. And modifying catalogs to expire data at the end of every transaction. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet/node')
-rw-r--r--lib/puppet/node/catalog.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/puppet/node/catalog.rb b/lib/puppet/node/catalog.rb
index 8862d0cc9..a438a4764 100644
--- a/lib/puppet/node/catalog.rb
+++ b/lib/puppet/node/catalog.rb
@@ -2,6 +2,8 @@ require 'puppet/indirector'
require 'puppet/simple_graph'
require 'puppet/transaction'
+require 'puppet/util/cacher'
+
require 'puppet/util/tagging'
# This class models a node catalog. It is the thing
@@ -15,6 +17,7 @@ class Puppet::Node::Catalog < Puppet::SimpleGraph
indirects :catalog, :terminus_class => :compiler
include Puppet::Util::Tagging
+ include Puppet::Util::Cacher::Expirer
# The host name this is a catalog for.
attr_accessor :name
@@ -394,6 +397,9 @@ class Puppet::Node::Catalog < Puppet::SimpleGraph
@transient_resources.clear
@relationship_graph = nil
end
+
+ # Expire any cached data the resources are keeping.
+ expire()
end
# Verify that the given resource isn't defined elsewhere.