From b93a642d4afb1dd694f877565810eaa3de5bc9b0 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Fri, 23 Jan 2009 16:58:54 -0600 Subject: 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 --- lib/puppet/ssl/host.rb | 8 ++++++++ spec/unit/ssl/host.rb | 8 ++++++++ 2 files changed, 16 insertions(+) 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 -- cgit