diff options
author | Nick Lewis <nick@puppetlabs.com> | 2011-07-21 11:52:00 -0700 |
---|---|---|
committer | Jacob Helwig <jacob@puppetlabs.com> | 2011-08-19 13:52:56 -0700 |
commit | 7c4dbeb24fcfac432ac9540bd4e92ba84d187472 (patch) | |
tree | 90011312bed15323412dde3d79a216baf82d07c9 /lib | |
parent | d6e0b71f141300da5241b6a0daf6afbc3eaa29e0 (diff) | |
download | puppet-7c4dbeb24fcfac432ac9540bd4e92ba84d187472.tar.gz puppet-7c4dbeb24fcfac432ac9540bd4e92ba84d187472.tar.xz puppet-7c4dbeb24fcfac432ac9540bd4e92ba84d187472.zip |
Remove Puppet::Util::Cacher use from Puppet::Indirector::Indirection
Previously, indirections were storing their termini in a cached_attr, so that
they could be easily cleared for tests. Because this provides no value outside
of testing, we instead simply create an attr_reader for termini, and expire
them manually in tests.
Reviewed-By: Jacob Helwig <jacob@puppetlabs.com>
(cherry picked from commit e74090468192697a6a2447dc6fcece3dd09a46f1)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/indirector/indirection.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/puppet/indirector/indirection.rb b/lib/puppet/indirector/indirection.rb index d958a82ac..20b260b83 100644 --- a/lib/puppet/indirector/indirection.rb +++ b/lib/puppet/indirector/indirection.rb @@ -1,13 +1,11 @@ require 'puppet/util/docs' require 'puppet/indirector/envelope' require 'puppet/indirector/request' -require 'puppet/util/cacher' # The class that connects functional classes with their different collection # back-ends. Each indirection has a set of associated terminus classes, # each of which is a subclass of Puppet::Indirector::Terminus. class Puppet::Indirector::Indirection - include Puppet::Util::Cacher include Puppet::Util::Docs @@indirections = [] @@ -33,6 +31,8 @@ class Puppet::Indirector::Indirection attr_accessor :name, :model + attr_reader :termini + # Create and return our cache terminus. def cache raise(Puppet::DevError, "Tried to cache when no cache class was set") unless cache_class @@ -88,6 +88,7 @@ class Puppet::Indirector::Indirection def initialize(model, name, options = {}) @model = model @name = name + @termini = {} @cache_class = nil @terminus_class = nil @@ -313,7 +314,4 @@ class Puppet::Indirector::Indirection end klass.new end - - # Cache our terminus instances indefinitely, but make it easy to clean them up. - cached_attr(:termini) { Hash.new } end |