diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-09-13 23:10:46 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-09-13 23:10:46 +0000 |
commit | cf5291a355dcdb92c0de4564633a30a4933f6b69 (patch) | |
tree | 66bfa074e92e6f1aa52d269dc9c00941653ea0d6 /lib/puppet/parser/interpreter.rb | |
parent | ca6ac62824ddbb14d827687ade5235801b70383c (diff) | |
download | puppet-cf5291a355dcdb92c0de4564633a30a4933f6b69.tar.gz puppet-cf5291a355dcdb92c0de4564633a30a4933f6b69.tar.xz puppet-cf5291a355dcdb92c0de4564633a30a4933f6b69.zip |
Fixing the interpreter to nodesearch across all listed names, just like is done in the manifests. Also fixing a comment in type.rb
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1586 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/parser/interpreter.rb')
-rw-r--r-- | lib/puppet/parser/interpreter.rb | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/puppet/parser/interpreter.rb b/lib/puppet/parser/interpreter.rb index ee770d02e..19d61c276 100644 --- a/lib/puppet/parser/interpreter.rb +++ b/lib/puppet/parser/interpreter.rb @@ -143,7 +143,7 @@ module Puppet # Search for our node in the various locations. This only searches # locations external to the files; the scope is responsible for # searching the parse tree. - def nodesearch(node) + def nodesearch(*nodes) # At this point, stop at the first source that defines # the node @nodesources.each do |source| @@ -151,18 +151,20 @@ module Puppet parent = nil nodeclasses = nil if self.respond_to? method - parent, nodeclasses = self.send(method, node) + nodes.each do |node| + parent, nodeclasses = self.send(method, node) - if parent or (nodeclasses and !nodeclasses.empty?) - Puppet.info "Found %s in %s" % [node, source] - return parent, nodeclasses - else - # Look for a default node. - parent, nodeclasses = self.send(method, "default") if parent or (nodeclasses and !nodeclasses.empty?) - Puppet.info "Found default node for %s in %s" % - [node, source] + Puppet.info "Found %s in %s" % [node, source] return parent, nodeclasses + else + # Look for a default node. + parent, nodeclasses = self.send(method, "default") + if parent or (nodeclasses and !nodeclasses.empty?) + Puppet.info "Found default node for %s in %s" % + [node, source] + return parent, nodeclasses + end end end end @@ -306,7 +308,7 @@ module Puppet args[:names] = names - parent, nodeclasses = nodesearch(client) + parent, nodeclasses = nodesearch(*names) args[:classes] += nodeclasses if nodeclasses |