]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
pybind/mgr/pg_autoscaler: drop py2 support
authorKefu Chai <kchai@redhat.com>
Sun, 28 Jun 2020 12:52:51 +0000 (20:52 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 5 Jul 2020 02:58:29 +0000 (10:58 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/pybind/mgr/pg_autoscaler/module.py

index 64e2a7465831aca9c68579b4592838ff1ee4c5f1..24a8e4a584c591aa4e2349df80127d3ef5a18812 100644 (file)
@@ -6,7 +6,6 @@ import json
 import mgr_util
 import threading
 import uuid
-from six import itervalues, iteritems
 from prettytable import PrettyTable
 from mgr_module import MgrModule
 
@@ -244,7 +243,7 @@ class PgAutoscaler(MgrModule):
 
             # do we intersect an existing root?
             s = None
-            for prev in itervalues(result):
+            for prev in result.values():
                 if osds & prev.osds:
                     s = prev
                     break
@@ -308,7 +307,7 @@ class PgAutoscaler(MgrModule):
         ret = []
 
         # iterate over all pools to determine how they should be sized
-        for pool_name, p in iteritems(pools):
+        for pool_name, p in pools.items():
             pool_id = p['pool']
             if pool_id not in pool_stats:
                 # race with pool deletion; skip
@@ -506,7 +505,7 @@ class PgAutoscaler(MgrModule):
             }
 
         too_much_target_bytes = []
-        for root_id, total in iteritems(total_bytes):
+        for root_id, total in total_bytes.items():
             total_target = total_target_bytes[root_id]
             if total_target > 0 and total > root_map[root_id].capacity and root_map[root_id].capacity:
                 too_much_target_bytes.append(