From 6be1eb89750593c63668827fcc6230747a03a3c0 Mon Sep 17 00:00:00 2001 From: Jesse Wolfe Date: Thu, 7 Apr 2011 14:06:18 -0700 Subject: Maint: fix a load order problem with type(:component) Puppet's autoloader has an incompatibility with ruby's native 'require' statement that makes it possible to reach the same code multiple times, which can cause genclass to create multiple classes with the same name. This patch fixes the uses of some puppet types so that they are loaded using the autoloader instead of using 'require'. Paired-With: Jacob Helwig --- lib/puppet/transaction/event_manager.rb | 2 +- lib/puppet/type.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/puppet/transaction/event_manager.rb b/lib/puppet/transaction/event_manager.rb index a21bbf892..f5da870ed 100644 --- a/lib/puppet/transaction/event_manager.rb +++ b/lib/puppet/transaction/event_manager.rb @@ -49,7 +49,7 @@ class Puppet::Transaction::EventManager # since eval_generated children can't have direct relationships. received = (event.name != :restarted) relationship_graph.matching_edges(event, resource).each do |edge| - received ||= true unless edge.target.is_a?(Puppet::Type::Whit) + received ||= true unless edge.target.is_a?(Puppet::Type.type(:whit)) next unless method = edge.callback next unless edge.target.respond_to?(method) diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb index 5ecc430d4..c0e5d390b 100644 --- a/lib/puppet/type.rb +++ b/lib/puppet/type.rb @@ -1901,4 +1901,4 @@ end require 'puppet/provider' # Always load these types. -require 'puppet/type/component' +Puppet::Type.type(:component) -- cgit