"test/ganeti.utils.process_unittest.py" did not exist on "153533f3e88434f3207999bd8c049a9921fb6804"
Michael Hanselmann
authored
This patch changes utils.NiceSort to use the built-in “sorted()” and gets rid of the intermediate list. Instead of wrapping the items ourselves, a key function is used. The caller can specify another key function (useful to sort objects by their name, e.g. “utils.NiceSort(instances, key=operator.attrgetter("name"))”. Unittests are provided. Signed-off-by:Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
Name | Last commit | Last update |
---|