From 5aff1c62c3c174dd152da5dd220a3c058f5263a7 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Thu, 15 Sep 2022 11:54:06 -0400 Subject: [PATCH] Island: Use drop() to clear mongo credentials collections --- .../monkey_island/cc/repository/mongo_credentials_repository.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monkey/monkey_island/cc/repository/mongo_credentials_repository.py b/monkey/monkey_island/cc/repository/mongo_credentials_repository.py index 20caa288b..20f0ca4d7 100644 --- a/monkey/monkey_island/cc/repository/mongo_credentials_repository.py +++ b/monkey/monkey_island/cc/repository/mongo_credentials_repository.py @@ -109,6 +109,6 @@ class MongoCredentialsRepository(ICredentialsRepository): @staticmethod def _remove_credentials_fom_collection(collection): try: - collection.delete_many({}) + collection.drop() except RemovalError as err: raise err