summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-06-14 05:19:26 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-06-14 05:19:26 +0000
commit9a1b9ec9ce8c148c73107b056729e5325a7ca478 (patch)
tree2f658fb9b85c613403b58233f5b50942e9e4d35f /lib/puppet/parser
parentc1dd0a1a157ea2d73e178c377b942b5f4053e317 (diff)
downloadpuppet-9a1b9ec9ce8c148c73107b056729e5325a7ca478.tar.gz
puppet-9a1b9ec9ce8c148c73107b056729e5325a7ca478.tar.xz
puppet-9a1b9ec9ce8c148c73107b056729e5325a7ca478.zip
Fixing some logging issues with puppetmasterd when daemonized with verbose mode on, and fixing ldap support when daemonizing
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1276 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/parser')
-rw-r--r--lib/puppet/parser/interpreter.rb33
1 files changed, 22 insertions, 11 deletions
diff --git a/lib/puppet/parser/interpreter.rb b/lib/puppet/parser/interpreter.rb
index daf8accf0..09ad2382f 100644
--- a/lib/puppet/parser/interpreter.rb
+++ b/lib/puppet/parser/interpreter.rb
@@ -53,6 +53,10 @@ module Puppet
)
attr_accessor :ast, :filetimeout
+
+ class << self
+ attr_writer :ldap
+ end
# just shorten the constant path a bit, using what amounts to an alias
AST = Puppet::Parser::AST
@@ -101,17 +105,7 @@ module Puppet
@nodesources << :ldap
end
- @nodesources.each { |source|
- method = "setup_%s" % source.to_s
- if respond_to? method
- begin
- self.send(method)
- rescue => detail
- raise Puppet::Error,
- "Could not set up node source %s" % source
- end
- end
- }
+ @setup = false
# Set it to either the value or nil. This is currently only used
# by the cfengine module.
@@ -137,6 +131,7 @@ module Puppet
# Connect to the LDAP Server
def setup_ldap
+ self.class.ldap = nil
begin
require 'ldap'
rescue LoadError
@@ -255,6 +250,22 @@ module Puppet
# evaluate our whole tree
def run(client, facts)
+
+ # We have to leave this for after initialization because there
+ # seems to be a problem keeping ldap open after a fork.
+ unless @setup
+ @nodesources.each { |source|
+ method = "setup_%s" % source.to_s
+ if respond_to? method
+ begin
+ self.send(method)
+ rescue => detail
+ raise Puppet::Error,
+ "Could not set up node source %s" % source
+ end
+ end
+ }
+ end
parsefiles()
# Really, we should stick multiple names in here