From 4b218a29524a7e78b4e07df466305d8519868f72 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 25 Dec 2019 09:40:35 -0600 Subject: [PATCH] mgr/balancer: sort pool names in 'balancer ls' output Otherwise this will vary based on the internal key sort order the dict it was generated from. Signed-off-by: Sage Weil --- src/pybind/mgr/balancer/module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pybind/mgr/balancer/module.py b/src/pybind/mgr/balancer/module.py index 9940eb2730dfe..c6953d37a0036 100644 --- a/src/pybind/mgr/balancer/module.py +++ b/src/pybind/mgr/balancer/module.py @@ -485,7 +485,7 @@ class Module(MgrModule): should_prune = True if should_prune: # some pools were gone, prune self.set_module_option('pool_ids', ','.join(final_ids)) - return (0, json.dumps(final_names, indent=4, sort_keys=True), '') + return (0, json.dumps(sorted(final_names), indent=4, sort_keys=True), '') elif command['prefix'] == 'balancer pool add': raw_names = command['pools'] pool_id_by_name = dict((p['pool_name'], p['pool']) for p in self.get_osdmap().dump().get('pools', [])) -- 2.39.5