diff options
author | Andrew Shafer <andrew@reductivelabs.com> | 2008-06-10 23:19:37 -0600 |
---|---|---|
committer | Andrew Shafer <andrew@reductivelabs.com> | 2008-06-10 23:19:37 -0600 |
commit | 946081b3c0bf24dc68a3a08fbcb6b5347e01de8f (patch) | |
tree | ce3dd2a23ec07ae21f1b06543e846a475bca37cf /bin | |
parent | 041ca27460013088b790fab377aba0a8e470ce51 (diff) | |
download | puppet-946081b3c0bf24dc68a3a08fbcb6b5347e01de8f.tar.gz puppet-946081b3c0bf24dc68a3a08fbcb6b5347e01de8f.tar.xz puppet-946081b3c0bf24dc68a3a08fbcb6b5347e01de8f.zip |
Try again
Add the class to handle certs, specs and modify puppetd
should fix 1190, 1199, 1200
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/puppetd | 33 |
1 files changed, 3 insertions, 30 deletions
diff --git a/bin/puppetd b/bin/puppetd index 96d0e5ee8..2a71c3a8d 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' @@ -342,36 +343,8 @@ if Puppet[:daemonize] client.daemonize end -unless Puppet::Network::HttpPool.read_cert - # If we don't already have the certificate, then create a client to - # request one. Use the special ca stuff, don't use the normal server and port. - caclient = Puppet::Network::Client.ca.new() - 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 Puppet::Network::HttpPool.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 = [] |