From b94002a984d7220f84f38d61169c0c1824290d47 Mon Sep 17 00:00:00 2001 From: Kekoa Kaaikala Date: Tue, 4 Oct 2022 14:56:57 +0000 Subject: [PATCH] Agent: Make publish methods private --- monkey/infection_monkey/exploit/HostExploiter.py | 4 ++-- .../infection_monkey/exploit/test_host_exploiter.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/monkey/infection_monkey/exploit/HostExploiter.py b/monkey/infection_monkey/exploit/HostExploiter.py index f910cfa49..e7dc45080 100644 --- a/monkey/infection_monkey/exploit/HostExploiter.py +++ b/monkey/infection_monkey/exploit/HostExploiter.py @@ -128,7 +128,7 @@ class HostExploiter: powershell = True if "powershell" in cmd.lower() else False self.exploit_info["executed_cmds"].append({"cmd": cmd, "powershell": powershell}) - def publish_propagation_event( + def _publish_propagation_event( self, target: str, propagation_success: bool, @@ -145,7 +145,7 @@ class HostExploiter: ) self.agent_event_queue.publish(propagation_event) - def publish_exploitation_event( + def _publish_exploitation_event( self, target: str, exploitation_success: bool, diff --git a/monkey/tests/unit_tests/infection_monkey/exploit/test_host_exploiter.py b/monkey/tests/unit_tests/infection_monkey/exploit/test_host_exploiter.py index 3f05b4eb9..47d2cb106 100644 --- a/monkey/tests/unit_tests/infection_monkey/exploit/test_host_exploiter.py +++ b/monkey/tests/unit_tests/infection_monkey/exploit/test_host_exploiter.py @@ -65,7 +65,7 @@ def test_publish_exploitation_event__uses_exploiter_name_by_default( options={}, interrupt=threading.Event(), ) - exploiter.publish_exploitation_event(target=str(TARGET), exploitation_success=True) + exploiter._publish_exploitation_event(target=str(TARGET), exploitation_success=True) expected_event = ExploitationEvent( source=AGENT_ID, target=TARGET, @@ -92,7 +92,7 @@ def test_publish_propagation_event__uses_exploiter_name_by_default( options={}, interrupt=threading.Event(), ) - exploiter.publish_propagation_event(target=str(TARGET), propagation_success=True) + exploiter._publish_propagation_event(target=str(TARGET), propagation_success=True) expected_event = PropagationEvent( source=AGENT_ID, target=TARGET, success=True, exploiter_name=FakeExploiter.__name__ )