summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-06-15 15:17:26 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-06-15 15:17:26 +0000
commit6ef3d88110fd44b51733d03ff01f5f84aa327fb7 (patch)
treec410cb383871f3bcaef4c5c665c937d4524903cb
parent662fcafdb8020b34b060d70d54fca996ece36ab8 (diff)
downloadpuppet-6ef3d88110fd44b51733d03ff01f5f84aa327fb7.tar.gz
puppet-6ef3d88110fd44b51733d03ff01f5f84aa327fb7.tar.xz
puppet-6ef3d88110fd44b51733d03ff01f5f84aa327fb7.zip
fixing interpreter to initialize ldap in the nodesearch_ldap method, which really only matters for testing (since it is already being inited in the nodesearch method
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1287 980ebf18-57e1-0310-9a29-db15c13687c0
-rw-r--r--lib/puppet/parser/interpreter.rb8
-rwxr-xr-xtest/language/snippets.rb5
2 files changed, 10 insertions, 3 deletions
diff --git a/lib/puppet/parser/interpreter.rb b/lib/puppet/parser/interpreter.rb
index 09ad2382f..04074d695 100644
--- a/lib/puppet/parser/interpreter.rb
+++ b/lib/puppet/parser/interpreter.rb
@@ -183,8 +183,11 @@ module Puppet
# the critical data.
def nodesearch_ldap(node)
unless defined? @ldap and @ldap
- Puppet.info "Skipping ldap source; no ldap connection"
- return nil, []
+ setup_ldap()
+ unless @ldap
+ Puppet.info "Skipping ldap source; no ldap connection"
+ return nil, []
+ end
end
if node =~ /\./
@@ -250,7 +253,6 @@ 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
diff --git a/test/language/snippets.rb b/test/language/snippets.rb
index c34d1b192..1e7b86968 100755
--- a/test/language/snippets.rb
+++ b/test/language/snippets.rb
@@ -466,6 +466,11 @@ class TestSnippets < Test::Unit::TestCase
# There's nothing to check other than that it works
end
+ def snippet_emptyexec(trans)
+ assert(FileTest.exists?("/tmp/emptyexectest"),
+ "Empty exec was ignored")
+ end
+
def disabled_snippet_dirchmod(trans)
dirs = %w{a b}.collect { |letter|
"/tmp/dirchmodtest%s" % letter