From: Kefu Chai Date: Mon, 6 Apr 2020 14:41:10 +0000 (+0800) Subject: qa/tasks/s3tests_java.py: do not change a dict while iterating it X-Git-Tag: wip-pdonnell-testing-20200918.022351~1585^2~15 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=dcecf1dbe4e456c060259b8591a887abc1f228bd;p=ceph-ci.git qa/tasks/s3tests_java.py: do not change a dict while iterating it 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 --- diff --git a/qa/tasks/s3tests_java.py b/qa/tasks/s3tests_java.py index 54954095258..1f8afd9eef8 100644 --- a/qa/tasks/s3tests_java.py +++ b/qa/tasks/s3tests_java.py @@ -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)