From 0d48b03db2d0caf9a55c35087f561e8d7cb295b0 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 4 Feb 2021 21:15:27 +0800 Subject: [PATCH] pybind/mgr/balancer: define Plan.{dump,show}() as they are called by the commands Signed-off-by: Kefu Chai --- src/pybind/mgr/balancer/module.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/pybind/mgr/balancer/module.py b/src/pybind/mgr/balancer/module.py index b3a9daa20e7..b5b9329a1f7 100644 --- a/src/pybind/mgr/balancer/module.py +++ b/src/pybind/mgr/balancer/module.py @@ -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()) -- 2.39.5