summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorNick Lewis <nick@puppetlabs.com>2011-07-21 11:52:50 -0700
committerJacob Helwig <jacob@puppetlabs.com>2011-08-19 13:52:56 -0700
commit9849d565ec4db6bf1a39413c3136da9713f9fa25 (patch)
treeac567dd0039442b5b63f77506c8755b2a3809bd7 /lib
parent028b795e2c705baa3652f26d8eec090e6b428d33 (diff)
downloadpuppet-9849d565ec4db6bf1a39413c3136da9713f9fa25.tar.gz
puppet-9849d565ec4db6bf1a39413c3136da9713f9fa25.tar.xz
puppet-9849d565ec4db6bf1a39413c3136da9713f9fa25.zip
Remove use of Puppet::Util::Cacher in Puppet::SSL::Host
This class was previously using a cached_attr for its 'localhost' attribute, representing the Puppet::SSL::Host entry corresponding to the cert in Puppet[:certname]. We now no longer expire this attribute. This has the effect that a change to certname during the lifetime of an agent will not be reflected in the certificate it uses. If this behavior is desired, it will need to be reimplemented another way. Reviewed-By: Jacob Helwig <jacob@puppetlabs.com> (cherry picked from commit 7048b4c4d8c4a8ad45caf6a02b263ac0a9fa333e)
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/ssl/host.rb13
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/puppet/ssl/host.rb b/lib/puppet/ssl/host.rb
index b9215effd..08a8ace1f 100644
--- a/lib/puppet/ssl/host.rb
+++ b/lib/puppet/ssl/host.rb
@@ -4,7 +4,6 @@ require 'puppet/ssl/key'
require 'puppet/ssl/certificate'
require 'puppet/ssl/certificate_request'
require 'puppet/ssl/certificate_revocation_list'
-require 'puppet/util/cacher'
# The class that manages all aspects of our SSL certificates --
# private keys, public keys, requests, etc.
@@ -27,14 +26,10 @@ class Puppet::SSL::Host
# This accessor is used in instances for indirector requests to hold desired state
attr_accessor :desired_state
- class << self
- include Puppet::Util::Cacher
-
- cached_attr(:localhost) do
- result = new
- result.generate unless result.certificate
- result.key # Make sure it's read in
- result
+ def self.localhost
+ @localhost ||= new.tap do |l|
+ l.generate unless l.certificate
+ l.key # Make sure it's read in
end
end