Skip to content

Commit

Permalink
pybind/mgr/balancer: define Plan.{dump,show}()
Browse files Browse the repository at this point in the history
as they are called by the commands

Signed-off-by: Kefu Chai <kchai@redhat.com>
  • Loading branch information
tchaikov committed Feb 7, 2021
1 parent 51ee392 commit 0d48b03
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/pybind/mgr/balancer/module.py
Expand Up @@ -68,6 +68,13 @@ def __init__(self, name, mode, osdmap, pools):
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.
Expand All @@ -84,9 +91,6 @@ def final_state(self) -> MappingState:
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())
Expand Down

0 comments on commit 0d48b03

Please sign in to comment.