puppetlabs/puppet — pull request #425 by daniel-pittman (2012-01-30 01:01:57+00:00)
Title: (#12269) multiple cycles in graph fail on sort

This fixes up code that handled the randomized hash ordering in Ruby 1.8.7 after a CVE fix:

At the time I felt it was safer to avoid changes to core classes, and instead to use an externally generated key for sorting. This turned out not to be the case - as so often the "safe" choice turns out t be worse that the "right" fix would have been.

This redresses that by extending the core `Puppet::Type` and `Puppet::Provider` classes to support ordering (against other instances of the same class, or subclasses), and then uses that everywhere that we need to express a natural ordering over sets of the same type.

It also adds an acceptance test, moves away from fake input data to tests, and generally improves our chances of detecting a similar problem next time through.