diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-10-05 20:47:20 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-10-05 20:47:20 +0000 |
| commit | b8920939ade4d9956a7f3b2ba3a2c77a3f788c58 (patch) | |
| tree | c0a78d5c5610c94968d8ca3b92715e1bbc7a7f21 /lib/puppet | |
| parent | 06a7d345bef7a41cb6320e14a1dd9476505fd65f (diff) | |
| download | puppet-b8920939ade4d9956a7f3b2ba3a2c77a3f788c58.tar.gz puppet-b8920939ade4d9956a7f3b2ba3a2c77a3f788c58.tar.xz puppet-b8920939ade4d9956a7f3b2ba3a2c77a3f788c58.zip | |
Fixing weird case where the default node is in one node source and the real node is in a different one
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1734 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet')
| -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 |
