diff options
| author | Jesse Wolfe <jes5199@gmail.com> | 2010-07-02 15:54:28 -0700 |
|---|---|---|
| committer | Markus Roberts <Markus@reality.com> | 2010-07-06 23:57:53 -0700 |
| commit | 6d4be90a6704ce26bad55e2d2cd3949526fea678 (patch) | |
| tree | a9c9741a5846215c3aa19ddf6731fa41c52bac6b | |
| parent | 0598f35d6680e6f58f564c6da546ab307d0f3c3b (diff) | |
| download | puppet-6d4be90a6704ce26bad55e2d2cd3949526fea678.tar.gz puppet-6d4be90a6704ce26bad55e2d2cd3949526fea678.tar.xz puppet-6d4be90a6704ce26bad55e2d2cd3949526fea678.zip | |
[#3961] Part two: --destroy should also be local
| -rw-r--r-- | lib/puppet/application/cert.rb | 2 | ||||
| -rwxr-xr-x | spec/unit/application/cert_spec.rb | 18 |
2 files changed, 19 insertions, 1 deletions
diff --git a/lib/puppet/application/cert.rb b/lib/puppet/application/cert.rb index 9625a7ffe..b2b788201 100644 --- a/lib/puppet/application/cert.rb +++ b/lib/puppet/application/cert.rb @@ -70,7 +70,7 @@ class Puppet::Application::Cert < Puppet::Application Puppet::Util::Log.newdestination :console - if @cert_mode == :generate + if [:generate, :destroy].include? @cert_mode Puppet::SSL::Host.ca_location = :local else Puppet::SSL::Host.ca_location = :only diff --git a/spec/unit/application/cert_spec.rb b/spec/unit/application/cert_spec.rb index a72532e50..c1ff38b26 100755 --- a/spec/unit/application/cert_spec.rb +++ b/spec/unit/application/cert_spec.rb @@ -112,6 +112,24 @@ describe Puppet::Application::Cert do @cert_app.setup end + + it "should set the ca_location to :local if the cert_mode is generate" do + @cert_app.find_mode('--generate') + Puppet::SSL::Host.expects(:ca_location=).with(:local) + @cert_app.setup + end + + it "should set the ca_location to :local if the cert_mode is destroy" do + @cert_app.find_mode('--destroy') + Puppet::SSL::Host.expects(:ca_location=).with(:local) + @cert_app.setup + end + + it "should set the ca_location to :only if the cert_mode is print" do + @cert_app.find_mode('--print') + Puppet::SSL::Host.expects(:ca_location=).with(:only) + @cert_app.setup + end end describe "when running" do |
