From: Sage Weil Date: Wed, 25 Dec 2019 15:40:35 +0000 (-0600) Subject: mgr/balancer: sort pool names in 'balancer ls' output X-Git-Tag: v15.1.0~363^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F32424%2Fhead;p=ceph.git 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 --- diff --git a/src/pybind/mgr/balancer/module.py b/src/pybind/mgr/balancer/module.py index 9940eb2730d..c6953d37a00 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', []))