]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr: drop unnecessary iterkeys usage to make py-3 compatible 25457/head
authorMykola Golub <mgolub@suse.com>
Mon, 10 Dec 2018 13:50:46 +0000 (13:50 +0000)
committerMykola Golub <mgolub@suse.com>
Mon, 10 Dec 2018 13:50:46 +0000 (13:50 +0000)
Fixes: http://tracker.ceph.com/issues/37581
Signed-off-by: Mykola Golub <mgolub@suse.com>
src/pybind/mgr/balancer/module.py
src/pybind/mgr/devicehealth/module.py

index 3d51aad7b954f475784d7043bfaa4cac88bca761..5e61e6539cd130b39c72f6c9df5191f06d5a1013 100644 (file)
@@ -492,7 +492,7 @@ class Module(MgrModule):
                 'objects': {},
                 'bytes': {},
             }
-            for osd in pe.target_by_root[root].iterkeys():
+            for osd in pe.target_by_root[root]:
                 actual_by_root[root]['pgs'][osd] = 0
                 actual_by_root[root]['objects'][osd] = 0
                 actual_by_root[root]['bytes'][osd] = 0
@@ -516,7 +516,7 @@ class Module(MgrModule):
             objects_by_osd = {}
             bytes_by_osd = {}
             for root in pe.pool_roots[pool]:
-                for osd in pe.target_by_root[root].iterkeys():
+                for osd in pe.target_by_root[root]:
                     pgs_by_osd[osd] = 0
                     objects_by_osd[osd] = 0
                     bytes_by_osd[osd] = 0
@@ -576,7 +576,7 @@ class Module(MgrModule):
                 'objects': objects,
                 'bytes': bytes,
             }
-        for root in pe.total_by_root.iterkeys():
+        for root in pe.total_by_root:
             pe.count_by_root[root] = {
                 'pgs': {
                     k: float(v)
@@ -768,7 +768,7 @@ class Module(MgrModule):
         overlap = {}
         root_ids = {}
         for root, wm in six.iteritems(pe.target_by_root):
-            for osd in wm.iterkeys():
+            for osd in wm:
                 if osd in visited:
                     if osd not in overlap:
                         overlap[osd] = [ visited[osd] ]
index 3513cd5269b4ca5784f75e1d8d32d756ad676168..1d51361cfa7c7e910da423ba3b51a7d24203b9c8 100644 (file)
@@ -489,7 +489,7 @@ class Module(MgrModule):
 
         # OSD might be marked 'out' (which means it has no
         # data), however PGs are still attached to it.
-        for _id in osds_out.iterkeys():
+        for _id in osds_out:
             num_pgs = self.get_osd_num_pgs(_id)
             if num_pgs > 0:
                 health_warnings[DEVICE_HEALTH_IN_USE].append(