Skip to content

Commit

Permalink
Fix dependency cycle check for 2.6.x
Browse files Browse the repository at this point in the history
  • Loading branch information
rodjek committed Feb 26, 2013
1 parent 433b303 commit fd67e50
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions lib/rspec-puppet/matchers/compile.rb
Expand Up @@ -17,13 +17,22 @@ module ManifestMatchers
begin
cat = catalogue.to_ral.relationship_graph
cat.write_graph(:resources)
cycles = cat.find_cycles_in_graph
if cycles.length > 0
cycles.each do |cycle|
paths = cat.paths_in_cycle(cycle)
@cycles << (paths.map{ |path| '(' + path.join(" => ") + ')'}.join("\n") + "\n")
if cat.respond_to? :find_cycles_in_graph
cycles = cat.find_cycles_in_graph
if cycles.length > 0
cycles.each do |cycle|
paths = cat.paths_in_cycle(cycle)
@cycles << (paths.map{ |path| '(' + path.join(" => ") + ')'}.join("\n") + "\n")
end
retval = false
end
else
begin
cat.topsort
rescue Puppet::Error => e
@cycles = [e.message.rpartition(';').first.partition(':').last]
retval = false
end
retval = false
end
rescue Puppet::Error
retval = false
Expand Down

0 comments on commit fd67e50

Please sign in to comment.