[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, master, updated. debian/0.24.7-1-98-gf19c0e5

James Turnbull james at lovedthanlost.net
Wed Apr 8 21:48:19 UTC 2009


The following commit has been merged in the master branch:
commit c052ff881e4a0cf6edfe4c1974597cd3abb378cf
Author: Paul Lathrop <paul at tertiusfamily.net>
Date:   Fri Feb 27 12:25:28 2009 -0800

    Make puppetd --waitforcert option behave as documented:
    
    "You can turn off waiting for certificates by specifying a time of 0."
    
    Also add a test to ensure we catch any future regression of this behavior.
    
    Signed-off-by: Paul Lathrop <paul at tertiusfamily.net>

diff --git a/lib/puppet/executables/client/certhandler.rb b/lib/puppet/executables/client/certhandler.rb
index b041397..bf3ea16 100644
--- a/lib/puppet/executables/client/certhandler.rb
+++ b/lib/puppet/executables/client/certhandler.rb
@@ -49,7 +49,12 @@ module Puppet
                           exit(23) if @one_time
                        end
 
-                       sleep @wait_for_cert 
+                        if @wait_for_cert > 0
+                            sleep @wait_for_cert
+                        else
+                            Puppet.notice "waitforcert disabled; exiting with no certificate"
+                            exit(1)
+                        end
                     end
                 end
 
diff --git a/spec/unit/executables/client/certhandler.rb b/spec/unit/executables/client/certhandler.rb
index 4f8f813..69d6de9 100755
--- a/spec/unit/executables/client/certhandler.rb
+++ b/spec/unit/executables/client/certhandler.rb
@@ -91,6 +91,19 @@ describe cert_handler, "when handling certificates" do
         end
     end
 
+    describe "when waitforcert is disabled" do
+        before do
+            @handler = cert_handler.new(0, false)
+            @handler.stubs(:read_cert).returns false
+        end
+
+        it "should exit if the cert request does not return a certificate" do
+            @caclient.stubs(:request_cert).returns(false)
+            @handler.expects(:exit).with(1).raises(SystemExit)
+            lambda { @handler.retrieve_cert }.should raise_error(SystemExit)
+        end
+    end
+
     describe "when in one time mode" do
         before do
             #true puts us in onetime mode

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list