Skip to content

Commit

Permalink
pybind/mgr/balancer: be more specific on execute() error
Browse files Browse the repository at this point in the history
i.e.:

Was:
~# ceph balancer execute upmap

Now:
~# ceph balancer execute upmap
Error EPERM: min_compat_client jewel < luminous, which is required for pg-upmap.
Try 'ceph osd set-require-min-compat-client luminous' before using the new interface

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
  • Loading branch information
xiexingguo committed Feb 5, 2018
1 parent 164ed93 commit 585ba6f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/pybind/mgr/balancer/module.py
Expand Up @@ -342,9 +342,9 @@ def handle_command(self, command):
plan = self.plans.get(command['plan'])
if not plan:
return (-errno.ENOENT, '', 'plan %s not found' % command['plan'])
self.execute(plan)
r, detail = self.execute(plan)
self.plan_rm(command['plan'])
return (0, '', '')
return (r, '', detail)
else:
return (-errno.EINVAL, '',
"Command not found '{0}'".format(command['prefix']))
Expand Down Expand Up @@ -914,7 +914,7 @@ def execute(self, plan):
r, outb, outs = result.wait()
if r != 0:
self.log.error('Error creating compat weight-set')
return
return r, outs

for osd, weight in plan.compat_ws.iteritems():
self.log.info('ceph osd crush weight-set reweight-compat osd.%d %f',
Expand Down Expand Up @@ -974,6 +974,7 @@ def execute(self, plan):
for result in commands:
r, outb, outs = result.wait()
if r != 0:
self.log.error('Error on command')
return
self.log.error('execute error: r = %d, detail = %s' % (r, outs))
return r, outs
self.log.debug('done')
return 0, ''

0 comments on commit 585ba6f

Please sign in to comment.