From: xie xingguo Date: Sat, 3 Feb 2018 14:05:02 +0000 (+0800) Subject: pybind/mgr/balancer: fix sanity check against empty weight-set X-Git-Tag: v12.2.5~81^2~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c3d1d2d9197e9bd2529f6802b58288069fa675d5;p=ceph.git pybind/mgr/balancer: fix sanity check against empty weight-set There are paths get_compat_weight_set_weights() will return a empty dict, not None. Signed-off-by: xie xingguo (cherry picked from commit f10696e7e1026a7de434325fb2caebe23704db14) --- diff --git a/src/pybind/mgr/balancer/module.py b/src/pybind/mgr/balancer/module.py index 4b85d65014f..359d946d004 100644 --- a/src/pybind/mgr/balancer/module.py +++ b/src/pybind/mgr/balancer/module.py @@ -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 }