]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr/balancer: cancel plan if distribution is already perfect 20305/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Fri, 2 Feb 2018 07:24:21 +0000 (15:24 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Wed, 7 Feb 2018 13:26:34 +0000 (21:26 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/pybind/mgr/balancer/module.py

index a07ae8538257d2f174a78d4541f0ce245480a0ff..faf5cfd1c509f7dd0ff5e24cdbf009c5695522f7 100644 (file)
@@ -679,6 +679,9 @@ class Module(MgrModule):
             if left <= 0:
                 break
         self.log.info('prepared %d/%d changes' % (total_did, max_iterations))
+        if total_did == 0:
+            return -errno.EALREADY, 'Unable to find further optimization,' \
+                                    'or distribution is already perfect'
         return 0, ''
 
     def do_crush_compat(self, plan):