233: def able_to_import?(classname,item,msg)
234: unless @loaded.include?(item)
235: begin
236: case @loading.owner_of(item)
237: when :this_thread
238: return
239: when :another_thread
240: return able_to_import?(classname,item,msg)
241: when :nobody
242: import(item)
243: Puppet.info "Autoloaded #{msg}"
244: @loaded << item
245: end
246: rescue Puppet::ImportError => detail
247:
248: ensure
249: @loading.done_with(item)
250: end
251: end
252:
253:
254: return @loaded_code.hostclass(classname) || @loaded_code.definition(classname)
255: end