summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLuke Kanies <luke@puppetlabs.com>2010-06-10 20:54:15 -0700
committertest branch <puppet-dev@googlegroups.com>2010-02-17 06:50:53 -0800
commitd6407f46f1743b9f3916d74bc0ed521fb5bf259d (patch)
tree2939d466d7f83fbf38f19187677f25379565edcd /lib
parent0b95a8528e554df07efe970c9ecfc34535d17c92 (diff)
downloadpuppet-d6407f46f1743b9f3916d74bc0ed521fb5bf259d.tar.gz
puppet-d6407f46f1743b9f3916d74bc0ed521fb5bf259d.tar.xz
puppet-d6407f46f1743b9f3916d74bc0ed521fb5bf259d.zip
Working #3139 - removing obsolete checking in Storage
We were type-checking the use of Storage for no good reason. I've removed all of that, so we can use either resources or their Refs for caching. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/util/storage.rb12
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/puppet/util/storage.rb b/lib/puppet/util/storage.rb
index 1b3d4983f..de2f3825e 100644
--- a/lib/puppet/util/storage.rb
+++ b/lib/puppet/util/storage.rb
@@ -22,18 +22,10 @@ class Puppet::Util::Storage
# types like exec, but it also means that if an object changes locations
# in the configuration it will lose its cache.
def self.cache(object)
- if object.is_a? Puppet::Type
- # We used to store things by path, now we store them by ref.
- # In oscar(0.20.0) this changed to using the ref.
- if @@state.include?(object.path)
- @@state[object.ref] = @@state[object.path]
- @@state.delete(object.path)
- end
- name = object.ref
- elsif object.is_a?(Symbol)
+ if object.is_a?(Symbol)
name = object
else
- raise ArgumentError, "You can only cache information for Types and symbols"
+ name = object.to_s
end
return @@state[name] ||= {}