]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr/balancer: fix sanity check against empty weight-set
authorxie xingguo <xie.xingguo@zte.com.cn>
Sat, 3 Feb 2018 14:05:02 +0000 (22:05 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Thu, 8 Feb 2018 05:41:16 +0000 (13:41 +0800)
There are paths get_compat_weight_set_weights() will return a
empty dict, not None.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
(cherry picked from commit f10696e7e1026a7de434325fb2caebe23704db14)

src/pybind/mgr/balancer/module.py

index 4b85d65014ffa7223c06ec8c6a0d67c0640838ba..359d946d004897380b0ff1048c326cd1ec055010 100644 (file)
@@ -674,7 +674,7 @@ class Module(MgrModule):
 
         # get current compat weight-set weights
         orig_ws = self.get_compat_weight_set_weights(ms)
-        if orig_ws is None:
+        if not orig_ws:
             return False
         orig_ws = { a: b for a, b in orig_ws.iteritems() if a >= 0 }