summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/ast/resource_reference.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/parser/ast/resource_reference.rb')
-rw-r--r--lib/puppet/parser/ast/resource_reference.rb16
1 files changed, 1 insertions, 15 deletions
diff --git a/lib/puppet/parser/ast/resource_reference.rb b/lib/puppet/parser/ast/resource_reference.rb
index 5b1b0aa3a..0f8e655bf 100644
--- a/lib/puppet/parser/ast/resource_reference.rb
+++ b/lib/puppet/parser/ast/resource_reference.rb
@@ -7,23 +7,9 @@ class Puppet::Parser::AST::ResourceReference < Puppet::Parser::AST::Branch
# Evaluate our object, but just return a simple array of the type
# and name.
def evaluate(scope)
- a_type = type
titles = Array(title.safeevaluate(scope))
- case type.downcase
- when "class"
- # resolve the titles
- titles = titles.collect do |a_title|
- hostclass = scope.find_hostclass(a_title)
- hostclass ? hostclass.name : a_title
- end
- when "node"
- # no-op
- else
- # resolve the type
- resource_type = scope.find_resource_type(type)
- a_type = resource_type.name if resource_type
- end
+ a_type, titles = scope.resolve_type_and_titles(type, titles)
resources = titles.collect{ |a_title|
Puppet::Resource.new(a_type, a_title)