From 778f2305898bfa12251299818ba241eb3e067656 Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Mon, 28 Mar 2022 20:26:03 +0530 Subject: [PATCH] Agent: Modify remaining PBAs to yield PostBreachData --- monkey/infection_monkey/post_breach/actions/schedule_jobs.py | 2 +- .../infection_monkey/post_breach/actions/use_signed_scripts.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/monkey/infection_monkey/post_breach/actions/schedule_jobs.py b/monkey/infection_monkey/post_breach/actions/schedule_jobs.py index 7bffce8a2..8846efcf9 100644 --- a/monkey/infection_monkey/post_breach/actions/schedule_jobs.py +++ b/monkey/infection_monkey/post_breach/actions/schedule_jobs.py @@ -23,4 +23,4 @@ class ScheduleJobs(PBA): def run(self): post_breach_data = super(ScheduleJobs, self).run() remove_scheduled_jobs() - return post_breach_data + yield post_breach_data diff --git a/monkey/infection_monkey/post_breach/actions/use_signed_scripts.py b/monkey/infection_monkey/post_breach/actions/use_signed_scripts.py index 085b73bb9..984fc0f66 100644 --- a/monkey/infection_monkey/post_breach/actions/use_signed_scripts.py +++ b/monkey/infection_monkey/post_breach/actions/use_signed_scripts.py @@ -24,7 +24,7 @@ class SignedScriptProxyExecution(PBA): original_comspec = subprocess.check_output( # noqa: DUO116 "if defined COMSPEC echo %COMSPEC%", shell=True ).decode() - return super().run() + yield super().run() except Exception as e: logger.warning( f"An exception occurred on running PBA "