From ba86ba039543fa4cd00df33b7fc16d77b9594bc8 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Tue, 11 May 2021 07:21:08 -0400 Subject: [PATCH] island: Decouple Database service from services.post_breach_files Since Database.reset_db() calls ConfigService.init_config() which calls ConfigService.reset_config() which calls services.post_breach_files.remove_PBA_files(), it is redundant to call remove_PBA_files() from Database.reset_db(). Removing this call has the added benefit of reducing the coupling between the Database service and services.post_breach_files --- monkey/monkey_island/cc/services/database.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/monkey/monkey_island/cc/services/database.py b/monkey/monkey_island/cc/services/database.py index 2efd3643a..d0656f946 100644 --- a/monkey/monkey_island/cc/services/database.py +++ b/monkey/monkey_island/cc/services/database.py @@ -6,7 +6,6 @@ from monkey_island.cc.database import mongo from monkey_island.cc.models.attack.attack_mitigations import AttackMitigations from monkey_island.cc.services.attack.attack_config import AttackConfig from monkey_island.cc.services.config import ConfigService -from monkey_island.cc.services.post_breach_files import remove_PBA_files logger = logging.getLogger(__name__) @@ -18,7 +17,6 @@ class Database(object): @staticmethod def reset_db(): logger.info("Resetting database") - remove_PBA_files() # We can't drop system collections. [ Database.drop_collection(x)