summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/transaction.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/puppet/transaction.rb b/lib/puppet/transaction.rb
index d19ef59ac..05fbe6914 100644
--- a/lib/puppet/transaction.rb
+++ b/lib/puppet/transaction.rb
@@ -162,6 +162,8 @@ class Transaction
# Start logging.
Puppet::Log.newdestination(@report)
+ prefetch()
+
begin
allevents = @objects.collect { |child|
events = []
@@ -250,6 +252,22 @@ class Transaction
@report = Report.new
end
+ # Prefetch any providers that support it. We don't support prefetching
+ # types, just providers.
+ def prefetch
+ @objects.collect { |obj|
+ if pro = obj.provider
+ pro.class
+ else
+ nil
+ end
+ }.reject { |o| o.nil? }.uniq.each do |klass|
+ if klass.respond_to?(:prefetch)
+ klass.prefetch
+ end
+ end
+ end
+
# Generate a transaction report.
def report
@resourcemetrics[:failed] = @failures.find_all do |name, num|