]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/balancer: fail a bit more gracefully if we can't create a compat weight-set
authorSage Weil <sage@redhat.com>
Wed, 8 Nov 2017 23:35:35 +0000 (17:35 -0600)
committerSage Weil <sage@redhat.com>
Fri, 10 Nov 2017 13:10:11 +0000 (07:10 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/pybind/mgr/balancer/module.py

index b8cc087b9e8b8edaf446e999e82902e934165370..8078143907079b773ce4cb54c8f707b46a467512 100644 (file)
@@ -656,6 +656,8 @@ class Module(MgrModule):
 
         # get current compat weight-set weights
         orig_ws = self.get_compat_weight_set_weights()
+        if orig_ws is None:
+            return False
         orig_ws = { a: b for a, b in orig_ws.iteritems() if a >= 0 }
 
         # Make sure roots don't overlap their devices.  If so, we