diff options
| -rw-r--r-- | lib/puppet/parser/interpreter.rb | 8 | ||||
| -rwxr-xr-x | test/language/snippets.rb | 5 |
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 |
