]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa/tasks/s3tests_java.py: do not change a dict while iterating it
authorKefu Chai <kchai@redhat.com>
Mon, 6 Apr 2020 14:41:10 +0000 (22:41 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 7 Apr 2020 13:51:23 +0000 (21:51 +0800)
in Python3, dict.items() returns a view instead of an instance of list,
so we have to materialize the view for changing the dict being iterated.

Signed-off-by: Kefu Chai <kchai@redhat.com>
qa/tasks/s3tests_java.py

index 549540952589e94341e9f61846f98b5ef77c36ab..1f8afd9eef8dde91cabcbd1c0d3afd9b61d1d1ef 100644 (file)
@@ -196,7 +196,7 @@ class S3tests_java(Task):
                 '/home/{local}/s3tests.teuth.config.yaml'.format(local=local_user))
             log.debug("S3 Tests Java: s3tests_conf is {s3cfg}".format(
                 s3cfg=s3tests_conf))
-            for section, user in self.users.items():
+            for section, user in list(self.users.items()):
                 if section in s3tests_conf:
                     s3_user_id = '{user}.{client}'.format(
                         user=user, client=client)