diff options
| author | Luke Kanies <luke@madstop.com> | 2008-06-14 13:53:56 -0500 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2008-06-14 13:53:56 -0500 |
| commit | 6a61198f9293674a4bf0aa75bfbca10e20f64d20 (patch) | |
| tree | 0b1b6c4ffe6e69c3c9d3e9650620e3afbd486f18 /bin/puppetd | |
| parent | eaa6eabc680cb6264594e30fd6a56e3e36765269 (diff) | |
| parent | 7b2c310e18b214424ae082e6ed2354a07b708c6f (diff) | |
Merge branch '0.24.x'
Also added the fixes to make the certhandler tests pass
even when certs exist; I'll deal with the conflict later.
Conflicts:
CHANGELOG
bin/puppetd
lib/puppet/network/http/handler.rb
lib/puppet/network/http/mongrel/rest.rb
spec/integration/indirector/rest.rb
spec/integration/network/server/mongrel.rb
spec/integration/network/server/webrick.rb
spec/unit/network/http/webrick.rb
Diffstat (limited to 'bin/puppetd')
| -rwxr-xr-x | bin/puppetd | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/bin/puppetd b/bin/puppetd index d408af7d3..c36b3ed97 100755 --- a/bin/puppetd +++ b/bin/puppetd @@ -162,6 +162,7 @@ trap(:INT) do end require 'puppet' +require 'puppet/executables/client/certhandler' require 'puppet/network/client' require 'getoptlong' @@ -347,35 +348,8 @@ if Puppet[:daemonize] client.daemonize end -caclient = Puppet::Network::Client.ca.new() - -unless caclient.read_cert - if options[:waitforcert] > 0 - begin - while ! caclient.request_cert do - Puppet.notice "Did not receive certificate" - sleep options[:waitforcert] - end - rescue => detail - Puppet.err "Could not request certificate: %s" % detail.to_s - exit(23) - end - else - unless caclient.request_cert - Puppet.notice "No certificates; exiting" - exit(1) - end - end - - # Now read the new cert in. - if caclient.read_cert - # If we read it in, then get rid of our existing http connection. - client.recycle_connection - Puppet.notice "Got signed certificate" - else - Puppet.err "Could not read certificates after retrieving them" - exit(34) - end +unless Puppet::Executables::Client::CertHandler.new(options[:waitforcert], options[:onetime]).read_retrieve + client.recycle_connection end objects = [] |
