summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Pittman <daniel@puppetlabs.com>2011-06-06 17:56:53 -0700
committerDaniel Pittman <daniel@puppetlabs.com>2011-06-07 15:00:48 -0700
commit973e752cc210cc64ec50b942ee989f6e6acaaca0 (patch)
tree2cb86fa5180338b07b6bd3e8a4cc7e44785802f7
parent5587b94ce1bcb4e86df1160e5238b535e10028da (diff)
downloadpuppet-973e752cc210cc64ec50b942ee989f6e6acaaca0.tar.gz
puppet-973e752cc210cc64ec50b942ee989f6e6acaaca0.tar.xz
puppet-973e752cc210cc64ec50b942ee989f6e6acaaca0.zip
(#7728) Suppress notifications from container whits.
We introduced changes to our graph to reduce the number of edges when we had container dependencies. As part of this the 'whit' object was created, and used as an intermediate vertex to simplify processing. During that change we introduced additional reporting, based on those whit objects, about containment relationships during resource application failure. Specifically, we would now report that the containing class(es) and stages of any failed resource were failed, point-blank. This was unclear, because the entire class had not failed, but only part of it, but also unhelpful, because it turned a single failure into at least one additional report that contained no additional information. Now, instead, we suppress reporting for the whit resources. We still process them identically; just the report is eliminated. It isn't absolutely clear that this is the correct long term direction for handling these objects, but it is the minimal change for the RC release. Reviewed-By: Jacob Helwig <jacob@puppetlabs.com>
-rw-r--r--lib/puppet/transaction.rb22
1 files changed, 20 insertions, 2 deletions
diff --git a/lib/puppet/transaction.rb b/lib/puppet/transaction.rb
index 3728a2fff..089f4d945 100644
--- a/lib/puppet/transaction.rb
+++ b/lib/puppet/transaction.rb
@@ -131,10 +131,22 @@ class Puppet::Transaction
# enough to check the immediate dependencies, which is why we use
# a tree from the reversed graph.
found_failed = false
+
+
+ # When we introduced the :whit into the graph, to reduce the combinatorial
+ # explosion of edges, we also ended up reporting failures for containers
+ # like class and stage. This is undesirable; while just skipping the
+ # output isn't perfect, it is RC-safe. --daniel 2011-06-07
+ suppress_report = (resource.class == Puppet::Type.type(:whit))
+
relationship_graph.dependencies(resource).each do |dep|
next unless failed?(dep)
- resource.notice "Dependency #{dep} has failures: #{resource_status(dep).failed}"
found_failed = true
+
+ # See above. --daniel 2011-06-06
+ unless suppress_report then
+ resource.notice "Dependency #{dep} has failures: #{resource_status(dep).failed}"
+ end
end
found_failed
@@ -336,7 +348,13 @@ class Puppet::Transaction
elsif ! scheduled?(resource)
resource.debug "Not scheduled"
elsif failed_dependencies?(resource)
- resource.warning "Skipping because of failed dependencies"
+ # When we introduced the :whit into the graph, to reduce the combinatorial
+ # explosion of edges, we also ended up reporting failures for containers
+ # like class and stage. This is undesirable; while just skipping the
+ # output isn't perfect, it is RC-safe. --daniel 2011-06-07
+ unless resource.class == Puppet::Type.type(:whit) then
+ resource.warning "Skipping because of failed dependencies"
+ end
elsif resource.virtual?
resource.debug "Skipping because virtual"
elsif resource.appliable_to_device? ^ for_network_device