]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.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>
Sun, 14 Jun 2020 08:34:52 +0000 (16:34 +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>
(cherry picked from commit dcecf1dbe4e456c060259b8591a887abc1f228bd)

qa/tasks/s3tests_java.py

index 5ccf46e8a43dd035c72c4da501a0250c35654db8..a93a90e5409b2aefad1f7124195f976382b877c1 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)