[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 0.25.5-639-g8f94f35

James Turnbull james at lovedthanlost.net
Wed Jul 14 10:29:45 UTC 2010


The following commit has been merged in the upstream branch:
commit a967b93a51ce509cf8631d78b8be8d4ab6da5657
Author: Brice Figureau <brice-puppet at daysofwonder.com>
Date:   Mon Dec 28 17:17:57 2009 +0100

    Feature #2395 - revoke when cleaning a certificate with puppetca
    
    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 <brice-puppet at daysofwonder.com>

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

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list