summaryrefslogtreecommitdiffstats
path: root/lib/puppet/client
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-03-02 07:30:14 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-03-02 07:30:14 +0000
commit95856eaaf02361ff597ca2c85e51cf141fe81280 (patch)
treedb31ba74ce65523fa9dcd4d1cae0cd75c55a4395 /lib/puppet/client
parentff1df8e1aef99dbdc222c5d5d808494fd08e7f83 (diff)
Okay, Puppet is now almost entirely capable of configuring itself. I have not yet added the extra tests to puppetmasterd to make sure it can start as a normal user, and the executables still fail some simple tests because they are producing output when they start (I will get rid of the output), but overall things look pretty good.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@965 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/client')
-rw-r--r--lib/puppet/client/ca.rb6
-rw-r--r--lib/puppet/client/master.rb16
2 files changed, 14 insertions, 8 deletions
diff --git a/lib/puppet/client/ca.rb b/lib/puppet/client/ca.rb
index 11989230c..a7fa71e88 100644
--- a/lib/puppet/client/ca.rb
+++ b/lib/puppet/client/ca.rb
@@ -7,7 +7,11 @@ class Puppet::Client::CAClient < Puppet::Client::ProxyClient
def initialize(hash = {})
if hash.include?(:CA)
- hash[:CA] = Puppet::Server::CA.new()
+ if hash[:CA].is_a? Hash
+ hash[:CA] = Puppet::Server::CA.new(hash[:CA])
+ else
+ hash[:CA] = Puppet::Server::CA.new()
+ end
end
super(hash)
diff --git a/lib/puppet/client/master.rb b/lib/puppet/client/master.rb
index f9694fb3d..02186b19d 100644
--- a/lib/puppet/client/master.rb
+++ b/lib/puppet/client/master.rb
@@ -66,11 +66,12 @@ class Puppet::Client::MasterClient < Puppet::Client
# Cache the config
def cache(text)
+ Puppet.config.use(:puppet, :sslcertificates, :puppetd)
Puppet.info "Caching configuration at %s" % self.cachefile
confdir = File.dirname(Puppet[:localconfig])
- unless FileTest.exists?(confdir)
- Puppet.recmkdir(confdir, 0770)
- end
+ #unless FileTest.exists?(confdir)
+ # Puppet.recmkdir(confdir, 0770)
+ #end
File.open(self.cachefile + ".tmp", "w", 0660) { |f|
f.print text
}
@@ -87,9 +88,10 @@ class Puppet::Client::MasterClient < Puppet::Client
# Disable running the configuration.
def disable
Puppet.notice "Disabling puppetd"
- unless FileTest.exists? File.dirname(Puppet[:puppetdlockfile])
- Puppet.recmkdir(File.dirname(Puppet[:puppetdlockfile]))
- end
+ Puppet.config.use(:puppet)
+ #unless FileTest.exists? File.dirname(Puppet[:puppetdlockfile])
+ # Puppet.recmkdir(File.dirname(Puppet[:puppetdlockfile]))
+ #end
begin
File.open(Puppet[:puppetdlockfile], "w") { |f| f.puts ""; f.flush }
rescue => detail
@@ -237,7 +239,7 @@ class Puppet::Client::MasterClient < Puppet::Client
#@objects = objects
# and perform any necessary final actions before we evaluate.
- Puppet::Type.finalize
+ @objects.finalize
return @objects
end