From fe4dcd8b5985084462f1ee6e5e9887a8975bf18e Mon Sep 17 00:00:00 2001 From: Jesse Wolfe Date: Sat, 10 Jul 2010 22:16:18 -0700 Subject: [#4208] Missing parameter breaks multithread compilation import_if_possible calls itself recursively, but it was failing to pass its block parameter to its younger self. Thus when the inner call reached the un-blocked case, it raised an exception rather than doing something useful. --- lib/puppet/parser/type_loader.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/puppet/parser') diff --git a/lib/puppet/parser/type_loader.rb b/lib/puppet/parser/type_loader.rb index e56ab9418..6c32f6a92 100644 --- a/lib/puppet/parser/type_loader.rb +++ b/lib/puppet/parser/type_loader.rb @@ -126,16 +126,16 @@ class Puppet::Parser::TypeLoader # Utility method factored out of load for handling thread-safety. # This isn't tested in the specs, because that's basically impossible. - def import_if_possible(file) + def import_if_possible(file, &blk) return if @loaded.include?(file) begin case @loading.owner_of(file) when :this_thread return when :another_thread - return import_if_possible(file) + return import_if_possible(file, &blk) when :nobody - yield + blk.call end rescue Puppet::ImportError => detail # We couldn't load the item -- cgit