summaryrefslogtreecommitdiffstats
path: root/lib/puppet/util/graph.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/util/graph.rb')
-rw-r--r--lib/puppet/util/graph.rb10
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/puppet/util/graph.rb b/lib/puppet/util/graph.rb
index 028df5539..a9744578b 100644
--- a/lib/puppet/util/graph.rb
+++ b/lib/puppet/util/graph.rb
@@ -17,20 +17,14 @@ module Puppet::Util::Graph
self.each do |child|
unless block_given? and ! yield(child)
graph.add_edge!(self, child)
-
- if graph.cyclic?
- raise Puppet::Error, "%s created a cyclic graph" % self
- end
if child.respond_to?(:to_graph)
child.to_graph(graph, &block)
end
end
end
-
- if graph.cyclic?
- raise Puppet::Error, "%s created a cyclic graph" % self
- end
+
+ # Do a topsort, which will throw an exception if the graph is cyclic.
graph
end