diff options
author | Nick Lewis <nick@puppetlabs.com> | 2011-07-21 11:52:50 -0700 |
---|---|---|
committer | Jacob Helwig <jacob@puppetlabs.com> | 2011-08-19 13:52:56 -0700 |
commit | 9849d565ec4db6bf1a39413c3136da9713f9fa25 (patch) | |
tree | ac567dd0039442b5b63f77506c8755b2a3809bd7 /spec | |
parent | 028b795e2c705baa3652f26d8eec090e6b428d33 (diff) | |
download | puppet-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 'spec')
-rwxr-xr-x | spec/unit/ssl/host_spec.rb | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/spec/unit/ssl/host_spec.rb b/spec/unit/ssl/host_spec.rb index e1680941f..f00451619 100755 --- a/spec/unit/ssl/host_spec.rb +++ b/spec/unit/ssl/host_spec.rb @@ -13,7 +13,7 @@ describe Puppet::SSL::Host, :fails_on_windows => true do after do # Cleaned out any cached localhost instance. - Puppet::Util::Cacher.expire + Puppet::SSL::Host.instance_variable_set(:@localhost, nil) Puppet::SSL::Host.ca_location = :none end @@ -82,16 +82,6 @@ describe Puppet::SSL::Host, :fails_on_windows => true do Puppet::SSL::Host.localhost.should == Puppet::SSL::Host.localhost end - it "should be able to expire the cached instance" do - one = stub 'host1', :certificate => "eh", :key => 'foo' - two = stub 'host2', :certificate => "eh", :key => 'foo' - Puppet::SSL::Host.expects(:new).times(2).returns(one).then.returns(two) - - Puppet::SSL::Host.localhost.should equal(one) - Puppet::Util::Cacher.expire - Puppet::SSL::Host.localhost.should equal(two) - end - it "should be able to verify its certificate matches its key" do Puppet::SSL::Host.new("foo").should respond_to(:certificate_matches_key?) end |