]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr/balancer: define Plan.{dump,show}()
authorKefu Chai <kchai@redhat.com>
Thu, 4 Feb 2021 13:15:27 +0000 (21:15 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 7 Feb 2021 12:18:42 +0000 (20:18 +0800)
as they are called by the commands

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/pybind/mgr/balancer/module.py

index b3a9daa20e792ebad37c8dda0002eb3a85b7e6ea..b5b9329a1f7c004806c1c83dc7f7fbdd3d7d2a85 100644 (file)
@@ -68,6 +68,13 @@ class Plan(object):
         self.inc = osdmap.new_incremental()
         self.pg_status = {}
 
+    def dump(self) -> str:
+        return json.dumps(self.inc.dump(), indent=4, sort_keys=True)
+
+    def show(self) -> str:
+        return 'upmap plan'
+
+
 class MsPlan(Plan):
     """
     Plan with a preloaded MappingState member.
@@ -84,9 +91,6 @@ class MsPlan(Plan):
                             self.initial.raw_pool_stats,
                             'plan %s final' % self.name)
 
-    def dump(self) -> str:
-        return json.dumps(self.inc.dump(), indent=4, sort_keys=True)
-
     def show(self) -> str:
         ls = []
         ls.append('# starting osdmap epoch %d' % self.initial.osdmap.get_epoch())