summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJesse Wolfe <jes5199@gmail.com>2010-07-10 22:16:18 -0700
committerJesse Wolfe <jes5199@gmail.com>2010-07-10 22:16:18 -0700
commitfe4dcd8b5985084462f1ee6e5e9887a8975bf18e (patch)
treefecc10c2c79ddaa5a1e13809398b3add93347e70 /lib
parente0283101e5745cd3715a0144836574586078793e (diff)
downloadpuppet-fe4dcd8b5985084462f1ee6e5e9887a8975bf18e.tar.gz
puppet-fe4dcd8b5985084462f1ee6e5e9887a8975bf18e.tar.xz
puppet-fe4dcd8b5985084462f1ee6e5e9887a8975bf18e.zip
[#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.
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/parser/type_loader.rb6
1 files changed, 3 insertions, 3 deletions
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