diff options
author | Luke Kanies <luke@madstop.com> | 2008-07-15 19:01:12 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2009-02-06 18:08:39 -0600 |
commit | 2afff60abe430dc1e2660fa82807e131e1dc71aa (patch) | |
tree | c9f65993e46214e9123ae6f79da368d185ba612d /lib/puppet/indirector/request.rb | |
parent | 361db45875768727d3c5f310c76850f350e6441f (diff) | |
download | puppet-2afff60abe430dc1e2660fa82807e131e1dc71aa.tar.gz puppet-2afff60abe430dc1e2660fa82807e131e1dc71aa.tar.xz puppet-2afff60abe430dc1e2660fa82807e131e1dc71aa.zip |
Adding support for skipping cached indirection instances.
This will allow the soon-to-be-created Agent class to
skip cached catalogs when desired.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet/indirector/request.rb')
-rw-r--r-- | lib/puppet/indirector/request.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/puppet/indirector/request.rb b/lib/puppet/indirector/request.rb index 49cc01aab..4149d0db9 100644 --- a/lib/puppet/indirector/request.rb +++ b/lib/puppet/indirector/request.rb @@ -4,7 +4,7 @@ require 'puppet/indirector' # Indirection call, and as a a result also handles REST calls. It's somewhat # analogous to an HTTP Request object, except tuned for our Indirector. class Puppet::Indirector::Request - attr_accessor :indirection_name, :key, :method, :options, :instance, :node, :ip, :authenticated + attr_accessor :indirection_name, :key, :method, :options, :instance, :node, :ip, :authenticated, :use_cache attr_accessor :server, :port, :uri, :protocol @@ -48,7 +48,16 @@ class Puppet::Indirector::Request # Look up the indirection based on the name provided. def indirection - Puppet::Indirector::Indirection.instance(@indirection_name) + Puppet::Indirector::Indirection.instance(indirection_name) + end + + # Should we allow use of the cached object? + def use_cache? + if defined?(@use_cache) + ! ! use_cache + else + true + end end # Are we trying to interact with multiple resources, or just one? |