Make gnt-node list -o(p|s)inst_list output stable
authorIustin Pop <iustin@google.com>
Mon, 11 Mar 2013 10:17:46 +0000 (11:17 +0100)
committerIustin Pop <iustin@google.com>
Tue, 12 Mar 2013 16:16:03 +0000 (17:16 +0100)
commitc81b97f22b5684f96c8a33b2e4997dc8a352a4f9
tree38b4556aab585801c51b583218ea5690a6cd4258
parent7c17db26ab4077ea71682bfa4ee02f1156a09333
Make gnt-node list -o(p|s)inst_list output stable

Currently, both the Python and Haskell code return the internal
instance list unsorted, which means the output can vary depending on
the phase of the moon (well, the Haskell code actually uses internally
a tree, sorted by the instance name, but it's implementation detail).

By adding an explicit sort step, we guarantee both stability of the
output and consistency between the two query paths.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
lib/query.py
src/Ganeti/Query/Node.hs
test/py/ganeti.query_unittest.py