diff options
author | Luke Kanies <luke@madstop.com> | 2009-01-23 16:58:54 -0600 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2009-02-06 18:08:41 -0600 |
commit | b93a642d4afb1dd694f877565810eaa3de5bc9b0 (patch) | |
tree | e4a2a5c9972e919a707135d9b0574f5bfb22d515 | |
parent | 212b3e3dff7cb8846e0d09d39faf226b60c62e6b (diff) | |
download | puppet-b93a642d4afb1dd694f877565810eaa3de5bc9b0.tar.gz puppet-b93a642d4afb1dd694f877565810eaa3de5bc9b0.tar.xz puppet-b93a642d4afb1dd694f877565810eaa3de5bc9b0.zip |
Resetting SSL cache terminii to nil when only using the ca
This is important because puppetmasterd changes its configurations
a couple of times, and we need to disable any previously-created
caches.
Signed-off-by: Luke Kanies <luke@madstop.com>
-rw-r--r-- | lib/puppet/ssl/host.rb | 8 | ||||
-rwxr-xr-x | spec/unit/ssl/host.rb | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/lib/puppet/ssl/host.rb b/lib/puppet/ssl/host.rb index ccb405f64..a65490c40 100644 --- a/lib/puppet/ssl/host.rb +++ b/lib/puppet/ssl/host.rb @@ -60,6 +60,14 @@ class Puppet::SSL::Host Certificate.cache_class = cache CertificateRequest.cache_class = cache CertificateRevocationList.cache_class = cache + else + # Make sure we have no cache configured. puppetmasterd + # switches the configurations around a bit, so it's important + # that we specify the configs for absolutely everything, every + # time. + Certificate.cache_class = nil + CertificateRequest.cache_class = nil + CertificateRevocationList.cache_class = nil end end diff --git a/spec/unit/ssl/host.rb b/spec/unit/ssl/host.rb index 6a64daed7..646f7b55b 100755 --- a/spec/unit/ssl/host.rb +++ b/spec/unit/ssl/host.rb @@ -175,6 +175,14 @@ describe Puppet::SSL::Host do Puppet::SSL::Host.ca_location = :only end + + it "should reset the cache class for Certificate, CertificateRevocationList, and CertificateRequest to nil" do + Puppet::SSL::Certificate.expects(:cache_class=).with nil + Puppet::SSL::CertificateRequest.expects(:cache_class=).with nil + Puppet::SSL::CertificateRevocationList.expects(:cache_class=).with nil + + Puppet::SSL::Host.ca_location = :only + end end describe "as 'none'" do |