Island: Add reset_machine_repository

This commit is contained in:
Mike Salvatore 2022-09-20 14:33:44 -04:00
parent 36142774dd
commit 35025ead18
2 changed files with 15 additions and 0 deletions

View File

@ -1 +1,2 @@
from .reset_agent_configuration import reset_agent_configuration
from .reset_machine_repository import reset_machine_repository

View File

@ -0,0 +1,14 @@
from monkey_island.cc.repository import IMachineRepository, initialize_machine_repository
class reset_machine_repository:
"""
Callable class that handles reset and reinitialization of IMachineRepository
"""
def __init__(self, machine_repository: IMachineRepository):
self._machine_repository = machine_repository
def __call__(self):
self._machine_repository.reset()
initialize_machine_repository(self._machine_repository)