From 7d1c7ec331207a63595396f6e8a1954a335c78c3 Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Mon, 10 Dec 2018 13:50:46 +0000 Subject: [PATCH] pybind/mgr: drop unnecessary iterkeys usage to make py-3 compatible Fixes: http://tracker.ceph.com/issues/37581 Signed-off-by: Mykola Golub --- src/pybind/mgr/balancer/module.py | 8 ++++---- src/pybind/mgr/devicehealth/module.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pybind/mgr/balancer/module.py b/src/pybind/mgr/balancer/module.py index 3d51aad7b95..5e61e6539cd 100644 --- a/src/pybind/mgr/balancer/module.py +++ b/src/pybind/mgr/balancer/module.py @@ -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] ] diff --git a/src/pybind/mgr/devicehealth/module.py b/src/pybind/mgr/devicehealth/module.py index 3513cd5269b..1d51361cfa7 100644 --- a/src/pybind/mgr/devicehealth/module.py +++ b/src/pybind/mgr/devicehealth/module.py @@ -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( -- 2.39.5