As the ticket says:
"the certificates would still be valid even if cleaned,
therefore, it makes more sense revoke them instead."

Signed-off-by: Brice Figureau <[email protected]>
---
 lib/puppet/application/puppetca.rb |    1 +
 spec/unit/application/puppetca.rb  |   10 ++++++++++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/lib/puppet/application/puppetca.rb 
b/lib/puppet/application/puppetca.rb
index 68ea3e5..adc1a6f 100644
--- a/lib/puppet/application/puppetca.rb
+++ b/lib/puppet/application/puppetca.rb
@@ -43,6 +43,7 @@ Puppet::Application.new(:puppetca) do
             hosts = ARGV.collect { |h| puts h; h.downcase }
         end
         begin
+            @ca.apply(:revoke, :to => hosts) if @mode == :destroy
             @ca.apply(@mode, :to => hosts)
         rescue => detail
             puts detail.backtrace if Puppet[:trace]
diff --git a/spec/unit/application/puppetca.rb 
b/spec/unit/application/puppetca.rb
index d5ee0d0..3a535f3 100644
--- a/spec/unit/application/puppetca.rb
+++ b/spec/unit/application/puppetca.rb
@@ -138,5 +138,15 @@ describe "PuppetCA" do
             @puppetca.main
         end
 
+        it "should revoke cert if mode is clean" do
+            @puppetca.mode = :destroy
+            ARGV.stubs(:collect).returns(["host"])
+
+            @ca.expects(:apply).with { |mode,to| mode == :revoke }
+            @ca.expects(:apply).with { |mode,to| mode == :destroy }
+
+            @puppetca.main
+        end
+
     end
 end
-- 
1.6.5.2

--

You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.


Reply via email to