diff --git a/monkey/monkey_island/cc/resources/agent_binaries.py b/monkey/monkey_island/cc/resources/agent_binaries.py index 0d746b932..91149baa2 100644 --- a/monkey/monkey_island/cc/resources/agent_binaries.py +++ b/monkey/monkey_island/cc/resources/agent_binaries.py @@ -1,4 +1,5 @@ import logging +from http import HTTPStatus from flask import make_response, send_file @@ -34,7 +35,7 @@ class AgentBinaries(AbstractResource): except KeyError as err: error_msg = f'No Agents are available for unsupported operating system "{os}": {err}' logger.error(error_msg) - return make_response({"error": error_msg}, 404) + return make_response({"error": error_msg}, HTTPStatus.NOT_FOUND) except RetrievalError as err: logger.error(err) - return make_response({"error": str(err)}, 500) + return make_response({"error": str(err)}, HTTPStatus.INTERNAL_SERVER_ERROR) diff --git a/monkey/monkey_island/cc/resources/clear_simulation_data.py b/monkey/monkey_island/cc/resources/clear_simulation_data.py index 8675bfe00..fa85cac70 100644 --- a/monkey/monkey_island/cc/resources/clear_simulation_data.py +++ b/monkey/monkey_island/cc/resources/clear_simulation_data.py @@ -1,3 +1,5 @@ +from http import HTTPStatus + from flask import make_response from monkey_island.cc.repository.i_credentials_repository import ICredentialsRepository @@ -20,4 +22,4 @@ class ClearSimulationData(AbstractResource): Database.reset_db(reset_config=False) self._credentials_repository.remove_stolen_credentials() - return make_response({}, 200) + return make_response({}, HTTPStatus.OK) diff --git a/monkey/monkey_island/cc/resources/reset_agent_configuration.py b/monkey/monkey_island/cc/resources/reset_agent_configuration.py index 274cad592..d2d394a02 100644 --- a/monkey/monkey_island/cc/resources/reset_agent_configuration.py +++ b/monkey/monkey_island/cc/resources/reset_agent_configuration.py @@ -1,3 +1,5 @@ +from http import HTTPStatus + from flask import make_response from monkey_island.cc.repository import IAgentConfigurationRepository @@ -18,4 +20,4 @@ class ResetAgentConfiguration(AbstractResource): """ self._agent_configuration_repository.reset_to_default() - return make_response({}, 200) + return make_response({}, HTTPStatus.OK)