Skip to content

Commit

Permalink
pybind/mgr/balancer: fix sanity check against empty weight-set
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
xiexingguo committed Feb 3, 2018
1 parent 3ac57a7 commit f10696e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pybind/mgr/balancer/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ def do_crush_compat(self, plan):

# 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 }

Expand Down

0 comments on commit f10696e

Please sign in to comment.