diff options
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/parser/compile.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/puppet/parser/compile.rb b/lib/puppet/parser/compile.rb index 7f568f1b3..93ba180a7 100644 --- a/lib/puppet/parser/compile.rb +++ b/lib/puppet/parser/compile.rb @@ -269,10 +269,11 @@ class Puppet::Parser::Compile found_something = false exceptwrap do - @collections.each do |collection| - if collection.evaluate - found_something = true - end + # We have to iterate over a dup of the array because + # collections can delete themselves from the list, which + # changes its length and causes some collections to get missed. + @collections.dup.each do |collection| + found_something = true if collection.evaluate end end |