]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/fs.py: use six.viewitems()
authorKefu Chai <kchai@redhat.com>
Sun, 5 Apr 2020 12:54:02 +0000 (20:54 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 3 Jun 2020 11:56:59 +0000 (19:56 +0800)
in python3, dict.viewitems() is replaced with dict.items().

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 51fc7a992204fb14aba2eb29d96c1785a79ca27f)

qa/tasks/fs.py

index 4b47e754bfa2460e81651685f065bb423dc0cd32..ca84dc7a56d7704979e4dbce5ebddced901811f4 100644 (file)
@@ -4,6 +4,7 @@ CephFS sub-tasks.
 
 import logging
 import re
+import six
 
 from tasks.cephfs.filesystem import Filesystem
 
@@ -38,7 +39,7 @@ def clients_evicted(ctx, config):
     for rank in fs.get_ranks(status=status):
         ls = fs.rank_asok(['session', 'ls'], rank=rank['rank'], status=status)
         for session in ls:
-            for client, evicted in clients.viewitems():
+            for client, evicted in six.viewitems(clients):
                 mount = mounts.get(client)
                 if mount is not None:
                     global_id = mount.get_global_id()
@@ -51,7 +52,7 @@ def clients_evicted(ctx, config):
 
     no_session = set(clients) - has_session
     should_assert = False
-    for client, evicted in clients.viewitems():
+    for client, evicted in six.viewitems(clients):
         mount = mounts.get(client)
         if mount is not None:
             if evicted: