diff options
| author | Luke Kanies <luke@madstop.com> | 2008-05-13 16:00:58 -0500 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2008-05-13 16:00:58 -0500 |
| commit | 6efe4000dda3379e867786a9c2d4ae0f0cdfc3be (patch) | |
| tree | a16fd1ae1f4aab7fe04af88daa78f1be1a2b1f3e /lib/puppet/ssl | |
| parent | 68d8d0ae0686939d94dae8ccc70e5582187335dc (diff) | |
| download | puppet-6efe4000dda3379e867786a9c2d4ae0f0cdfc3be.tar.gz puppet-6efe4000dda3379e867786a9c2d4ae0f0cdfc3be.tar.xz puppet-6efe4000dda3379e867786a9c2d4ae0f0cdfc3be.zip | |
Using the new Cacher class for handling cached data.
This provides a single, global bit for determining whether
a given piece of cached data is still valid.
Diffstat (limited to 'lib/puppet/ssl')
| -rw-r--r-- | lib/puppet/ssl/certificate_authority.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/puppet/ssl/certificate_authority.rb b/lib/puppet/ssl/certificate_authority.rb index cd5d79f0a..6947af11c 100644 --- a/lib/puppet/ssl/certificate_authority.rb +++ b/lib/puppet/ssl/certificate_authority.rb @@ -1,5 +1,6 @@ require 'puppet/ssl/host' require 'puppet/ssl/certificate_request' +require 'puppet/util/cacher' # The class that knows how to sign certificates. It creates # a 'special' SSL::Host whose name is 'ca', thus indicating @@ -16,6 +17,8 @@ class Puppet::SSL::CertificateAuthority require 'puppet/ssl/certificate_authority/interface' + extend Puppet::Util::Cacher + def self.ca? return false unless Puppet[:ca] return false unless Puppet[:name] == "puppetmasterd" @@ -27,11 +30,7 @@ class Puppet::SSL::CertificateAuthority def self.instance return nil unless ca? - unless defined?(@instance) and @instance - @instance = new - end - - @instance + attr_cache(:instance) { new } end attr_reader :name, :host |
