diff options
Diffstat (limited to 'lib/puppet/parser/ast/collection.rb')
| -rw-r--r-- | lib/puppet/parser/ast/collection.rb | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/puppet/parser/ast/collection.rb b/lib/puppet/parser/ast/collection.rb index e3afbbd8f..030f1c239 100644 --- a/lib/puppet/parser/ast/collection.rb +++ b/lib/puppet/parser/ast/collection.rb @@ -13,7 +13,20 @@ class Puppet::Parser::AST count = 0 # Now perform the actual collection, yo. + + # First get everything from the export table. + + # FIXME This will only find objects that are before us in the tree, + # which is a problem. + objects = scope.exported(type) + + array = objects.values + Puppet::Rails::RailsObject.find_all_by_collectable(true).each do |obj| + if objects.include?(obj.name) + debug("%s[%s] is already exported" % [type, obj.name]) + next + end count += 1 trans = obj.to_trans @@ -30,13 +43,15 @@ class Puppet::Parser::AST args[:arguments] = {} trans.each do |p,v| args[:arguments][p] = v end - + # XXX Because the scopes don't expect objects to return values, # we have to manually add our objects to the scope. This is # uber-lame. scope.setobject(args) end + + scope.debug("Collected %s objects of type %s" % [count, type]) |
