From 403adb8af42cc79701b5ff47b377e7dc1e192a34 Mon Sep 17 00:00:00 2001 From: Daniel Pittman Date: Fri, 21 Jan 2011 23:53:56 -0800 Subject: 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. --- lib/puppet/simple_graph.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib') 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 -- cgit