From be6e76757d8ebc28acc0685fee560c64540cf371 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Mon, 28 Jun 2021 11:25:13 -0400 Subject: [PATCH] agent: Move telemetry messenger construction out of "try" --- monkey/infection_monkey/monkey.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monkey/infection_monkey/monkey.py b/monkey/infection_monkey/monkey.py index 506bc5db2..28e59c616 100644 --- a/monkey/infection_monkey/monkey.py +++ b/monkey/infection_monkey/monkey.py @@ -472,9 +472,9 @@ class InfectionMonkey(object): @staticmethod def run_ransomware(): + telemetry_messenger = LegacyTelemetryMessengerAdapter() + batching_telemetry_messenger = BatchingTelemetryMessenger(telemetry_messenger) try: - telemetry_messenger = LegacyTelemetryMessengerAdapter() - batching_telemetry_messenger = BatchingTelemetryMessenger(telemetry_messenger) RansomewarePayload( WormConfiguration.ransomware, batching_telemetry_messenger ).run_payload()