Skip to content

Commit

Permalink
(maint) remove dead code for indirector cache
Browse files Browse the repository at this point in the history
@use_cache was never set, so use_cache? always returned true.
The option to set for not using cache is ignore_cache.
  • Loading branch information
Erik Dalén committed Jan 13, 2014
1 parent 097e9fd commit 8fc9544
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
2 changes: 1 addition & 1 deletion lib/puppet/indirector/indirection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def find(key, options={})
result = terminus.find(request)
if not result.nil?
result.expiration ||= self.expiration if result.respond_to?(:expiration)
if cache? and request.use_cache?
if cache?
Puppet.info "Caching #{self.name} for #{request.key}"
cache.save request(:save, key, result, options)
end
Expand Down
9 changes: 0 additions & 9 deletions lib/puppet/indirector/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,6 @@ def model
i.model
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?
def plural?
method == :search
Expand Down

0 comments on commit 8fc9544

Please sign in to comment.