summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/ast/resource_reference.rb
diff options
context:
space:
mode:
authorJesse Wolfe <jes5199@gmail.com>2010-08-12 13:53:13 -0700
committerJesse Wolfe <jes5199@gmail.com>2010-08-12 13:53:29 -0700
commit1f3070c4bc77b38e3dd6170cf6a58bee7ec337ac (patch)
tree3c6495838d1b876528cb4522de3484c44749140d /lib/puppet/parser/ast/resource_reference.rb
parentd5db8db116aff58215ab0feebd7ec02086040f51 (diff)
parent0f56c1b02d40f1f8552d933dd78b24745937b137 (diff)
downloadpuppet-1f3070c4bc77b38e3dd6170cf6a58bee7ec337ac.tar.gz
puppet-1f3070c4bc77b38e3dd6170cf6a58bee7ec337ac.tar.xz
puppet-1f3070c4bc77b38e3dd6170cf6a58bee7ec337ac.zip
Merge branch 'next'
This synchronizes the 2.7 master branch with 2.6.1RC2
Diffstat (limited to 'lib/puppet/parser/ast/resource_reference.rb')
-rw-r--r--lib/puppet/parser/ast/resource_reference.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/puppet/parser/ast/resource_reference.rb b/lib/puppet/parser/ast/resource_reference.rb
index 5d8334335..0f8e655bf 100644
--- a/lib/puppet/parser/ast/resource_reference.rb
+++ b/lib/puppet/parser/ast/resource_reference.rb
@@ -7,8 +7,15 @@ 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)
- titles = Array(title.safeevaluate(scope)).collect { |t| Puppet::Resource.new(type, t, :namespaces => scope.namespaces) }
- return(titles.length == 1 ? titles.pop : titles)
+ titles = Array(title.safeevaluate(scope))
+
+ a_type, titles = scope.resolve_type_and_titles(type, titles)
+
+ resources = titles.collect{ |a_title|
+ Puppet::Resource.new(a_type, a_title)
+ }
+
+ return(resources.length == 1 ? resources.pop : resources)
end
def to_s