summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser
diff options
context:
space:
mode:
authorMarkus Roberts <Markus@reality.com>2010-11-15 19:19:02 -0800
committerMarkus Roberts <Markus@reality.com>2010-11-16 11:10:14 -0800
commitb2ff6a50202a05f2925fa5046a39ef7f163983f1 (patch)
treed2a2d7cb084d0292f8506dc12d490c135d67d6bb /lib/puppet/parser
parent1ce00dccb840abd9e11432d00c73bdd1de104751 (diff)
downloadpuppet-b2ff6a50202a05f2925fa5046a39ef7f163983f1.tar.gz
puppet-b2ff6a50202a05f2925fa5046a39ef7f163983f1.tar.xz
puppet-b2ff6a50202a05f2925fa5046a39ef7f163983f1.zip
Fix for #5298 -- Collections need to do type lookup
When the responsibility for type-name resolution was moved to the AST nodes in commit 449315a2c705df2396852462a1d1e14774b9f117, at least one instance was missed: the space ship operator Myclass <<| tag == foo |>> fails unless Myclass has been previously loaded. This commit adds the lookup to AST::Collection nodes in the same way it was added to the other node types. Note that I haven't audited the other note types for similar cases.
Diffstat (limited to 'lib/puppet/parser')
-rw-r--r--lib/puppet/parser/ast/collection.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/puppet/parser/ast/collection.rb b/lib/puppet/parser/ast/collection.rb
index 90a914337..ef36b7143 100644
--- a/lib/puppet/parser/ast/collection.rb
+++ b/lib/puppet/parser/ast/collection.rb
@@ -15,7 +15,8 @@ class Puppet::Parser::AST
def evaluate(scope)
str, code = query && query.safeevaluate(scope)
- newcoll = Puppet::Parser::Collector.new(scope, @type, str, code, self.form)
+ resource_type = scope.find_resource_type(@type)
+ newcoll = Puppet::Parser::Collector.new(scope, resource_type.name, str, code, self.form)
scope.compiler.add_collection(newcoll)