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
This commit is contained in:
parent
f048cf313c
commit
ba86ba0395
|
@ -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.models.attack.attack_mitigations import AttackMitigations
|
||||||
from monkey_island.cc.services.attack.attack_config import AttackConfig
|
from monkey_island.cc.services.attack.attack_config import AttackConfig
|
||||||
from monkey_island.cc.services.config import ConfigService
|
from monkey_island.cc.services.config import ConfigService
|
||||||
from monkey_island.cc.services.post_breach_files import remove_PBA_files
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -18,7 +17,6 @@ class Database(object):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def reset_db():
|
def reset_db():
|
||||||
logger.info("Resetting database")
|
logger.info("Resetting database")
|
||||||
remove_PBA_files()
|
|
||||||
# We can't drop system collections.
|
# We can't drop system collections.
|
||||||
[
|
[
|
||||||
Database.drop_collection(x)
|
Database.drop_collection(x)
|
||||||
|
|
Loading…
Reference in New Issue