You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2020/03/10 16:12:03 UTC
[allura] 11/14: [#8354] avoid error: dictionary changed size during
iteration
This is an automated email from the ASF dual-hosted git repository.
brondsem pushed a commit to branch db/8354
in repository https://gitbox.apache.org/repos/asf/allura.git
commit 921c3b7dd616e1aaced245de7464a98218d0aa15
Author: Dave Brondsema <da...@brondsema.net>
AuthorDate: Fri Mar 6 17:52:12 2020 -0500
[#8354] avoid error: dictionary changed size during iteration
---
Allura/allura/websetup/bootstrap.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Allura/allura/websetup/bootstrap.py b/Allura/allura/websetup/bootstrap.py
index 46c8832..9280175 100644
--- a/Allura/allura/websetup/bootstrap.py
+++ b/Allura/allura/websetup/bootstrap.py
@@ -290,7 +290,7 @@ def wipe_database():
continue
log.info('Wiping database %s', database)
db = conn[database]
- for coll in db.collection_names():
+ for coll in list(db.collection_names()):
if coll.startswith('system.'):
continue
log.info('Dropping collection %s:%s', database, coll)
@@ -304,7 +304,7 @@ def clear_all_database_tables():
conn = M.main_doc_session.bind.conn
for db in conn.database_names():
db = conn[db]
- for coll in db.collection_names():
+ for coll in list(db.collection_names()):
if coll == 'system.indexes':
continue
db.drop_collection(coll)