From 0d08ce467e117ade919f03fa79760c09455f7114 Mon Sep 17 00:00:00 2001 From: vakarisz Date: Fri, 23 Sep 2022 09:42:25 +0300 Subject: [PATCH] Agent: Fix mypy issues in ransomware and encryption --- monkey/infection_monkey/payload/ransomware/ransomware.py | 2 +- monkey/infection_monkey/telemetry/file_encryption_telem.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/monkey/infection_monkey/payload/ransomware/ransomware.py b/monkey/infection_monkey/payload/ransomware/ransomware.py index 47d4c0f89..4a50bed72 100644 --- a/monkey/infection_monkey/payload/ransomware/ransomware.py +++ b/monkey/infection_monkey/payload/ransomware/ransomware.py @@ -70,7 +70,7 @@ class Ransomware: self._send_telemetry(filepath, False, str(ex)) def _send_telemetry(self, filepath: Path, success: bool, error: str): - encryption_attempt = FileEncryptionTelem(str(filepath), success, error) + encryption_attempt = FileEncryptionTelem(filepath, success, error) self._telemetry_messenger.send_telemetry(encryption_attempt) @interruptible_function(msg="Received a stop signal, skipping leave readme") diff --git a/monkey/infection_monkey/telemetry/file_encryption_telem.py b/monkey/infection_monkey/telemetry/file_encryption_telem.py index 7f18867ab..d03a8dbb6 100644 --- a/monkey/infection_monkey/telemetry/file_encryption_telem.py +++ b/monkey/infection_monkey/telemetry/file_encryption_telem.py @@ -16,7 +16,7 @@ class FileEncryptionTelem(BatchableTelemMixin, IBatchableTelem, BaseTelem): """ super().__init__() - self._telemetry_entries.append({"path": filepath, "success": success, "error": error}) + self._telemetry_entries.append({"path": str(filepath), "success": success, "error": error}) telem_category = TelemCategoryEnum.FILE_ENCRYPTION