diff --git a/monkey/monkey_island/cc/resources/island_mode.py b/monkey/monkey_island/cc/resources/island_mode.py index 0eb10c35e..d3086f484 100644 --- a/monkey/monkey_island/cc/resources/island_mode.py +++ b/monkey/monkey_island/cc/resources/island_mode.py @@ -6,6 +6,7 @@ from flask import request from monkey_island.cc.event_queue import IIslandEventQueue, IslandEventTopic from monkey_island.cc.models import IslandMode as IslandModeEnum +from monkey_island.cc.repository import ISimulationRepository from monkey_island.cc.resources.AbstractResource import AbstractResource from monkey_island.cc.resources.request_authentication import jwt_required from monkey_island.cc.services import IslandModeService @@ -17,10 +18,14 @@ class IslandMode(AbstractResource): urls = ["/api/island/mode"] def __init__( - self, island_mode_service: IslandModeService, island_event_queue: IIslandEventQueue + self, + island_mode_service: IslandModeService, + island_event_queue: IIslandEventQueue, + simulation_repository: ISimulationRepository, ): self._island_mode_service = island_mode_service self._island_event_queue = island_event_queue + self._simulation_repository = simulation_repository @jwt_required def put(self): @@ -38,5 +43,5 @@ class IslandMode(AbstractResource): @jwt_required def get(self): - island_mode = self._island_mode_service.get_mode() + island_mode = self._simulation_repository.get_mode() return island_mode.value, HTTPStatus.OK