]> 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)
committerPrashant D <pdhange@redhat.com>
Mon, 20 Nov 2017 01:47:41 +0000 (20:47 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 476b2335fd08568d142d17848bfc58dc6e5c86d2)

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