summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-01-30 16:18:24 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-01-30 16:18:24 +0000
commit96b761b53e1284392975672a23dac0be504367c4 (patch)
treea5a9dc573f7031ff0a7169953438fae7b5cf01de
parentc7f9942a0305c8a583e222a004f18d4a8ed41837 (diff)
downloadpuppet-96b761b53e1284392975672a23dac0be504367c4.tar.gz
puppet-96b761b53e1284392975672a23dac0be504367c4.tar.xz
puppet-96b761b53e1284392975672a23dac0be504367c4.zip
Fixing waitforcert so that the client can actually add the certs once it receives them
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@856 980ebf18-57e1-0310-9a29-db15c13687c0
-rwxr-xr-xbin/puppetd8
-rwxr-xr-xlib/puppet/daemon.rb7
-rw-r--r--lib/puppet/networkclient.rb4
-rw-r--r--lib/puppet/server/master.rb8
4 files changed, 26 insertions, 1 deletions
diff --git a/bin/puppetd b/bin/puppetd
index 18cfe7107..e575a8405 100755
--- a/bin/puppetd
+++ b/bin/puppetd
@@ -255,6 +255,14 @@ unless client.readcert
exit(1)
end
end
+
+ # Now, because the Net::HTTP object cannot be modified once we've connected,
+ # we need to recreate the client with the certs intact
+ client = Puppet::Client::MasterClient.new(args)
+ unless client.readcert
+ PUppet.err "Could not read certificates after retrieving them"
+ exit(34)
+ end
end
if args[:Daemonize]
diff --git a/lib/puppet/daemon.rb b/lib/puppet/daemon.rb
index a8ef0a87a..fcedff3d7 100755
--- a/lib/puppet/daemon.rb
+++ b/lib/puppet/daemon.rb
@@ -3,7 +3,8 @@
require 'puppet'
module Puppet
- # A module that handles operations common to all daemons.
+ # A module that handles operations common to all daemons. This is included
+ # into the Server and Client base classes.
module Daemon
def daemonname
$0.sub(/.+#{File::SEPARATOR}/,'')
@@ -74,6 +75,7 @@ module Puppet
return log
end
+ # Read in an existing certificate.
def readcert
return unless @secureinit
# verify we've got all of the certs set up and such
@@ -109,6 +111,9 @@ module Puppet
return true
end
+ # Request a certificate from the remote system. This does all of the work
+ # of creating the cert request, contacting the remote system, and
+ # storing the cert locally.
def requestcert
retrieved = false
# create the directories involved
diff --git a/lib/puppet/networkclient.rb b/lib/puppet/networkclient.rb
index 31bc9a9dd..fc204ce10 100644
--- a/lib/puppet/networkclient.rb
+++ b/lib/puppet/networkclient.rb
@@ -134,6 +134,10 @@ module Puppet
def local
false
end
+
+ def local?
+ false
+ end
end
end
end
diff --git a/lib/puppet/server/master.rb b/lib/puppet/server/master.rb
index 1b9883ead..377b8e9e1 100644
--- a/lib/puppet/server/master.rb
+++ b/lib/puppet/server/master.rb
@@ -145,6 +145,14 @@ class Server
return CGI.escape(str)
end
end
+
+ def local?
+ if defined? @local and @local
+ return true
+ else
+ return false
+ end
+ end
end
end
end