]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/balancer: sort pool names in 'balancer ls' output 32424/head
authorSage Weil <sage@redhat.com>
Wed, 25 Dec 2019 15:40:35 +0000 (09:40 -0600)
committerSage Weil <sage@redhat.com>
Wed, 25 Dec 2019 15:40:35 +0000 (09:40 -0600)
Otherwise this will vary based on the internal key sort order the dict it
was generated from.

Signed-off-by: Sage Weil <sage@redhat.com>
src/pybind/mgr/balancer/module.py

index 9940eb2730dfe133e98707be9dc993469b3fe0f4..c6953d37a0036f45f42f3911d2bdc75cda4e459f 100644 (file)
@@ -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', []))