From: Mykola Golub Date: Mon, 10 Dec 2018 13:50:46 +0000 (+0000) Subject: pybind/mgr: drop unnecessary iterkeys usage to make py-3 compatible X-Git-Tag: v13.2.5~108^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=14a3098f07ad7b1f841804fd1f105c3f937cbc39;p=ceph.git pybind/mgr: drop unnecessary iterkeys usage to make py-3 compatible Fixes: http://tracker.ceph.com/issues/37581 Signed-off-by: Mykola Golub (cherry picked from commit 7d1c7ec331207a63595396f6e8a1954a335c78c3) Conflicts: src/pybind/mgr/devicehealth/module.py : Removed as not available in mimic --- diff --git a/src/pybind/mgr/balancer/module.py b/src/pybind/mgr/balancer/module.py index 8f0ea5fc84a..12a7fe29193 100644 --- a/src/pybind/mgr/balancer/module.py +++ b/src/pybind/mgr/balancer/module.py @@ -486,7 +486,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 @@ -510,7 +510,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 @@ -570,7 +570,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) @@ -760,7 +760,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] ]