]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr/balancer: fix sanity check against empty weight-set 20278/head
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>
Sat, 3 Feb 2018 14:05:02 +0000 (22:05 +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>
src/pybind/mgr/balancer/module.py

index 3b5d7f9379035dd35bac7b4997b6a4655b9030a9..3b63871a1fa945ff3a018d18671824b44b64c80d 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 }