summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-08-07 18:16:01 -0700
committerLuke Kanies <luke@madstop.com>2008-08-07 18:16:01 -0700
commit09ee814a8203c33c074a09e5a9802adc395ae309 (patch)
tree7ca7898c6538e9712b468f51dcc44828668a8f4b /lib/puppet
parentcd314fa0531b0d71017e22b9db4cec2fc21c7e7c (diff)
downloadpuppet-09ee814a8203c33c074a09e5a9802adc395ae309.tar.gz
puppet-09ee814a8203c33c074a09e5a9802adc395ae309.tar.xz
puppet-09ee814a8203c33c074a09e5a9802adc395ae309.zip
Removing now-obsolete the wait-for-cert module.
This functionality has moved into the SSL::Host class. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/executables/client/certhandler.rb77
1 files changed, 0 insertions, 77 deletions
diff --git a/lib/puppet/executables/client/certhandler.rb b/lib/puppet/executables/client/certhandler.rb
deleted file mode 100644
index b73642941..000000000
--- a/lib/puppet/executables/client/certhandler.rb
+++ /dev/null
@@ -1,77 +0,0 @@
-
-module Puppet
- module Executables
- module Client
- class CertHandler
- attr_writer :wait_for_cert, :one_time
- attr_reader :caclient, :new_cert
-
- def initialize(wait_time, is_one_time)
- @wait_for_cert = wait_time
- @one_time = is_one_time
- @new_cert = false
-
- @caclient = Puppet::Network::Client.ca.new()
- end
-
- # Did we just read a cert?
- def new_cert?
- new_cert
- end
-
- # Read, or retrieve if necessary, our certificate. Returns true if we retrieved
- # a new cert, false if the cert already exists.
- def read_retrieve
- #NOTE: ACS this is checking that a file exists, maybe next time just do that?
- unless 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.
- retrieve_cert
- end
-
- ! new_cert?
- end
-
- def retrieve_cert
- while true do
- begin
- if caclient.request_cert
- break if read_new_cert
- else
- Puppet.notice "Did not receive certificate"
- if @one_time
- Puppet.notice "Set to run 'one time'; exiting with no certificate"
- exit(1)
- end
- end
- rescue StandardError => detail
- Puppet.err "Could not request certificate: %s" % detail.to_s
- exit(23) if @one_time
- end
-
- sleep @wait_for_cert
- end
- end
-
- def read_cert
- caclient.read_cert
- end
-
- def read_new_cert
- if caclient.read_cert
- # If we read it in, then we need to get rid of our existing http connection.
- # The @new_cert flag will help us do that, in that it provides a way
- # to notify that the cert status has changed.
- @new_cert = true
- Puppet.notice "Got signed certificate"
- else
- Puppet.err "Could not read certificates after retrieving them"
- exit(34) if @one_time
- end
-
- return @new_cert
- end
- end
- end
- end
-end