summaryrefslogtreecommitdiffstats
path: root/lib/puppet/util/cacher.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/util/cacher.rb')
-rw-r--r--lib/puppet/util/cacher.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/puppet/util/cacher.rb b/lib/puppet/util/cacher.rb
index c1b3bad7a..a9fb890c6 100644
--- a/lib/puppet/util/cacher.rb
+++ b/lib/puppet/util/cacher.rb
@@ -59,7 +59,14 @@ module Puppet::Util::Cacher
# Methods that get added to instances.
module InstanceMethods
def expire
- expirer.expire
+ # Only expire if we have an expirer. This is
+ # mostly so that we can comfortably handle cases
+ # like Puppet::Type instances, which use their
+ # catalog as their expirer, and they often don't
+ # have a catalog.
+ if e = expirer
+ e.expire
+ end
end
def expirer