From cef41c26eaec80aeaf1e28c2224bfa764df4519e Mon Sep 17 00:00:00 2001 From: luke Date: Mon, 19 Mar 2007 04:40:25 +0000 Subject: A slight fix for #507. This should at least provide better information if this problem crops up, although I cannot reproduce it. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2308 980ebf18-57e1-0310-9a29-db15c13687c0 --- lib/puppet/pgraph.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/puppet/pgraph.rb b/lib/puppet/pgraph.rb index 80a272cdf..ce6c1e411 100644 --- a/lib/puppet/pgraph.rb +++ b/lib/puppet/pgraph.rb @@ -57,9 +57,15 @@ class Puppet::PGraph < GRATR::Digraph bad << v unless sorted.include?(v) end - raise Puppet::Error, "Found dependency cycle involving %s" % bad.collect do |v| - v.to_s - end.join(", ") + if bad.length > 0 + raise Puppet::Error, + "Found dependency cycle involving %s" % bad.collect do |v| + v.to_s + end.join(", ") + else + raise Puppet::Error, + "Found dependency cycle but could not find the cause" + end end # Which resources a given resource depends upon. -- cgit