diff options
Diffstat (limited to 'lib/puppet/parser')
| -rw-r--r-- | lib/puppet/parser/interpreter.rb | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/lib/puppet/parser/interpreter.rb b/lib/puppet/parser/interpreter.rb index 60e449db6..787fd8838 100644 --- a/lib/puppet/parser/interpreter.rb +++ b/lib/puppet/parser/interpreter.rb @@ -307,7 +307,7 @@ class Puppet::Parser::Interpreter end # By default, we only search for parsed nodes. - @nodesources = [:code] + @nodesources = [] if Puppet[:ldapnodes] # Nodes in the file override nodes in ldap. @@ -327,6 +327,10 @@ class Puppet::Parser::Interpreter end end + unless @nodesources.include?(:code) + @nodesources << :code + end + @setup = false initparsevars() @@ -584,18 +588,20 @@ class Puppet::Parser::Interpreter nsource = obj.file || source Puppet.info "Found %s in %s" % [node, nsource] return obj - else - # Look for a default node. - if defobj = self.send(method, "default") - Puppet.info "Found default node for %s in %s" % - [node, source] - return defobj - end end end end end + # If they made it this far, we haven't found anything, so look for a + # default node. + unless nodes.include?("default") + if defobj = self.nodesearch("default") + Puppet.notice "Using default node for %s" % [nodes[0]] + return defobj + end + end + return nil end |
