summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDaniel Pittman <daniel@rimspace.net>2011-01-21 23:53:56 -0800
committerDaniel Pittman <daniel@rimspace.net>2011-02-03 16:45:30 -0800
commit403adb8af42cc79701b5ff47b377e7dc1e192a34 (patch)
tree09879f1d9ce1e1a63ec51337ad1eb108f122f098 /lib
parent1ad6470e3df59caf67c484ef4e43274314c0bc40 (diff)
downloadpuppet-403adb8af42cc79701b5ff47b377e7dc1e192a34.tar.gz
puppet-403adb8af42cc79701b5ff47b377e7dc1e192a34.tar.xz
puppet-403adb8af42cc79701b5ff47b377e7dc1e192a34.zip
Feature #2597 -- nicer reporting of relationships.
Split out the reporting from a single line (often with literally hundreds or thousands of items) into a multi-line report. This is still nasty, but at least it is easier to use as input to other systems. This will also auto-join to a single line when sent to targets such as syslog that do not approve of newlines in messages; this preserves the utility of the message without needing to lose console utility.
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/simple_graph.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/puppet/simple_graph.rb b/lib/puppet/simple_graph.rb
index 29e46c9bd..f9a665d3c 100644
--- a/lib/puppet/simple_graph.rb
+++ b/lib/puppet/simple_graph.rb
@@ -119,8 +119,10 @@ class Puppet::SimpleGraph
if cycles = degree.values.reject { |ns| ns.empty? } and cycles.length > 0
message = cycles.collect { |edges|
'(' + edges.collect { |e| e[1].to_s }.join(", ") + ')'
- }.join(", ")
- raise Puppet::Error, "Found dependency cycles in the following relationships: #{message}; try using the '--graph' option and open the '.dot' files in OmniGraffle or GraphViz"
+ }.join("\n")
+ raise Puppet::Error, "Found dependency cycles in the following relationships:\n" +
+ message + "\n" +
+ "Try the '--graph' option and opening the '.dot' file in OmniGraffle or GraphViz"
end
result