[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5

Daniel Pittman daniel at rimspace.net
Tue May 10 08:04:20 UTC 2011


The following commit has been merged in the experimental branch:
commit 403adb8af42cc79701b5ff47b377e7dc1e192a34
Author: Daniel Pittman <daniel at rimspace.net>
Date:   Fri Jan 21 23:53:56 2011 -0800

    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.

diff --git a/lib/puppet/simple_graph.rb b/lib/puppet/simple_graph.rb
index 29e46c9..f9a665d 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
diff --git a/spec/unit/simple_graph_spec.rb b/spec/unit/simple_graph_spec.rb
index 0d1a3b4..58978f2 100755
--- a/spec/unit/simple_graph_spec.rb
+++ b/spec/unit/simple_graph_spec.rb
@@ -305,7 +305,7 @@ describe Puppet::SimpleGraph do
 
     it "should produce the correct relationship text" do
       add_edges :a => :b, :b => :a
-      want = %r{following relationships: \(b => a\), \(a => b\)}
+      want = %r{following relationships:\n\(b => a\)\n\(a => b\)}
       expect { @graph.topsort }.to raise_error(Puppet::Error, want)
     end
 

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list