diff --git a/monkey/infection_monkey/agent_event_forwarder.py b/monkey/infection_monkey/agent_event_forwarder.py index 1be153fa3..f280ad4f3 100644 --- a/monkey/infection_monkey/agent_event_forwarder.py +++ b/monkey/infection_monkey/agent_event_forwarder.py @@ -14,7 +14,7 @@ logger = logging.getLogger(__name__) DEFAULT_TIME_PERIOD_SECONDS = 5 -EVENTS_API_URL = "https://%s/api/agent-events" +AGENT_EVENTS_API_URL = "https://%s/api/agent-events" class AgentEventForwarder: @@ -86,7 +86,7 @@ class BatchingAgentEventForwarder: try: logger.debug(f"Sending Agent events to Island at {self._server_address}: {events}") requests.post( # noqa: DUO123 - EVENTS_API_URL % (self._server_address,), + AGENT_EVENTS_API_URL % (self._server_address,), json=events, verify=False, timeout=MEDIUM_REQUEST_TIMEOUT, diff --git a/monkey/tests/unit_tests/infection_monkey/test_agent_event_forwarder.py b/monkey/tests/unit_tests/infection_monkey/test_agent_event_forwarder.py index 7e7009c1c..718f11de9 100644 --- a/monkey/tests/unit_tests/infection_monkey/test_agent_event_forwarder.py +++ b/monkey/tests/unit_tests/infection_monkey/test_agent_event_forwarder.py @@ -3,7 +3,7 @@ import time import pytest import requests_mock -from infection_monkey.agent_event_forwarder import EVENTS_API_URL, BatchingAgentEventForwarder +from infection_monkey.agent_event_forwarder import AGENT_EVENTS_API_URL, BatchingAgentEventForwarder SERVER = "1.1.1.1:9999" @@ -20,7 +20,7 @@ def event_sender(): def test_send_events(event_sender): with requests_mock.Mocker() as mock: - mock.post(EVENTS_API_URL % SERVER) + mock.post(AGENT_EVENTS_API_URL % SERVER) event_sender.start() @@ -38,7 +38,7 @@ def test_send_events(event_sender): def test_send_remaining_events(event_sender): with requests_mock.Mocker() as mock: - mock.post(EVENTS_API_URL % SERVER) + mock.post(AGENT_EVENTS_API_URL % SERVER) event_sender.start()