diff options
| author | Jesse Wolfe <jes5199@gmail.com> | 2011-04-21 18:12:22 -0700 |
|---|---|---|
| committer | Jesse Wolfe <jes5199@gmail.com> | 2011-04-21 18:12:22 -0700 |
| commit | e185be0a6d35c84a60b940f233f87c0908547dee (patch) | |
| tree | 7bc25912f6ed0f41fa4cf7fd15dbc10ab87db550 /lib/puppet | |
| parent | dc378c024a08c2b989297ad2f8ed50830baf0dcf (diff) | |
| parent | 5c245418115396df655f86065d2d1d3af62e39ee (diff) | |
| download | puppet-e185be0a6d35c84a60b940f233f87c0908547dee.tar.gz puppet-e185be0a6d35c84a60b940f233f87c0908547dee.tar.xz puppet-e185be0a6d35c84a60b940f233f87c0908547dee.zip | |
Merge branch 'ticket/2.7.x/7084' into 2.7.x
Diffstat (limited to 'lib/puppet')
| -rw-r--r-- | lib/puppet/resource/catalog.rb | 14 | ||||
| -rw-r--r-- | lib/puppet/transaction/event_manager.rb | 17 | ||||
| -rw-r--r-- | lib/puppet/type/whit.rb | 8 |
3 files changed, 29 insertions, 10 deletions
diff --git a/lib/puppet/resource/catalog.rb b/lib/puppet/resource/catalog.rb index a6cff9bdc..b742d283f 100644 --- a/lib/puppet/resource/catalog.rb +++ b/lib/puppet/resource/catalog.rb @@ -74,7 +74,7 @@ class Puppet::Resource::Catalog < Puppet::SimpleGraph raise ArgumentError, "Can only add objects that respond to :ref, not instances of #{resource.class}" unless resource.respond_to?(:ref) fail_on_duplicate_type_and_title(resource) title_key = title_key_for_ref(resource.ref) - + @transient_resources << resource if applying? @resource_table[title_key] = resource @@ -339,8 +339,8 @@ class Puppet::Resource::Catalog < Puppet::SimpleGraph @relationship_graph end - # Impose our container information on another graph by using it - # to replace any container vertices X with a pair of verticies + # Impose our container information on another graph by using it + # to replace any container vertices X with a pair of verticies # { admissible_X and completed_X } such that that # # 0) completed_X depends on admissible_X @@ -353,8 +353,8 @@ class Puppet::Resource::Catalog < Puppet::SimpleGraph # Note that this requires attention to the possible case of containers # which contain or depend on other containers, but has the advantage # that the number of new edges created scales linearly with the number - # of contained verticies regardless of how containers are related; - # alternatives such as replacing container-edges with content-edges + # of contained verticies regardless of how containers are related; + # alternatives such as replacing container-edges with content-edges # scale as the product of the number of external dependences, which is # to say geometrically in the case of nested / chained containers. # @@ -374,8 +374,8 @@ class Puppet::Resource::Catalog < Puppet::SimpleGraph admissible = Hash.new { |h,k| k } completed = Hash.new { |h,k| k } containers.each { |x| - admissible[x] = whit_class.new(:name => "admissible_#{x.name}", :catalog => self) - completed[x] = whit_class.new(:name => "completed_#{x.name}", :catalog => self) + admissible[x] = whit_class.new(:name => "admissible_#{x.ref}", :catalog => self) + completed[x] = whit_class.new(:name => "completed_#{x.ref}", :catalog => self) } # # Implement the six requierments listed above diff --git a/lib/puppet/transaction/event_manager.rb b/lib/puppet/transaction/event_manager.rb index f5da870ed..8f1a695af 100644 --- a/lib/puppet/transaction/event_manager.rb +++ b/lib/puppet/transaction/event_manager.rb @@ -62,7 +62,18 @@ class Puppet::Transaction::EventManager end def queue_events_for_resource(source, target, callback, events) - source.info "Scheduling #{callback} of #{target}" + whit = Puppet::Type.type(:whit) + + # The message that a resource is refreshing the completed-whit for its own class + # is extremely counter-intuitive. Basically everything else is easy to understand, + # if you suppress the whit-lookingness of the whit resources + refreshing_c_whit = target.is_a?(whit) && target.name =~ /^completed_/ + + if refreshing_c_whit + source.debug "The container #{target} will propagate my #{callback} event" + else + source.info "Scheduling #{callback} of #{target}" + end @event_queues[target] ||= {} @event_queues[target][callback] ||= [] @@ -82,7 +93,9 @@ class Puppet::Transaction::EventManager process_noop_events(resource, callback, events) and return false unless events.detect { |e| e.status != "noop" } resource.send(callback) - resource.notice "Triggered '#{callback}' from #{events.length} events" + if not resource.is_a?(Puppet::Type.type(:whit)) + resource.notice "Triggered '#{callback}' from #{events.length} events" + end return true rescue => detail resource.err "Failed to call #{callback}: #{detail}" diff --git a/lib/puppet/type/whit.rb b/lib/puppet/type/whit.rb index 55ed0386e..4c77915b3 100644 --- a/lib/puppet/type/whit.rb +++ b/lib/puppet/type/whit.rb @@ -5,8 +5,14 @@ Puppet::Type.newtype(:whit) do desc "The name of the whit, because it must have one." end + + # Hide the fact that we're a whit from logs def to_s - "(#{name})" + name.sub(/^completed_|^admissible_/, "") + end + + def path + to_s end def refresh |
