From 826d409dd242253aa56bb87bc659b9e00959d318 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Wed, 13 Jul 2022 09:05:15 -0400 Subject: [PATCH] Island: Use RepositoryService in ResetAgentConfiguration resource --- .../cc/resources/reset_agent_configuration.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/monkey/monkey_island/cc/resources/reset_agent_configuration.py b/monkey/monkey_island/cc/resources/reset_agent_configuration.py index d2d394a02..36b49820e 100644 --- a/monkey/monkey_island/cc/resources/reset_agent_configuration.py +++ b/monkey/monkey_island/cc/resources/reset_agent_configuration.py @@ -2,22 +2,22 @@ from http import HTTPStatus from flask import make_response -from monkey_island.cc.repository import IAgentConfigurationRepository from monkey_island.cc.resources.AbstractResource import AbstractResource from monkey_island.cc.resources.request_authentication import jwt_required +from monkey_island.cc.services import RepositoryService class ResetAgentConfiguration(AbstractResource): urls = ["/api/reset-agent-configuration"] - def __init__(self, agent_configuration_repository: IAgentConfigurationRepository): - self._agent_configuration_repository = agent_configuration_repository + def __init__(self, repository_service: RepositoryService): + self._repository_service = repository_service @jwt_required def post(self): """ Reset the agent configuration to its default values """ - self._agent_configuration_repository.reset_to_default() + self._repository_service.reset_agent_configuration() return make_response({}, HTTPStatus.OK)