From fd3cc46e55d1b5bf7985f0287a397de2a9fb8454 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Wed, 14 Jul 2021 11:49:37 -0400 Subject: [PATCH] Agent: Remove unused return value from RansomwarePayload._encrypt_files --- monkey/infection_monkey/ransomware/ransomware_payload.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/monkey/infection_monkey/ransomware/ransomware_payload.py b/monkey/infection_monkey/ransomware/ransomware_payload.py index 52604089c..32530b287 100644 --- a/monkey/infection_monkey/ransomware/ransomware_payload.py +++ b/monkey/infection_monkey/ransomware/ransomware_payload.py @@ -1,7 +1,7 @@ import logging from pathlib import Path from pprint import pformat -from typing import Callable, List, Optional, Tuple +from typing import Callable, List from common.utils.file_utils import InvalidPath, expand_path from infection_monkey.telemetry.file_encryption_telem import FileEncryptionTelem @@ -66,10 +66,9 @@ class RansomwarePayload: LOG.info(f"Collecting files in {self._target_dir}") return sorted(self._select_files(self._target_dir)) - def _encrypt_files(self, file_list: List[Path]) -> List[Tuple[Path, Optional[Exception]]]: + def _encrypt_files(self, file_list: List[Path]): LOG.info(f"Encrypting files in {self._target_dir}") - results = [] for filepath in file_list: try: LOG.debug(f"Encrypting {filepath}") @@ -79,8 +78,6 @@ class RansomwarePayload: LOG.warning(f"Error encrypting {filepath}: {ex}") self._send_telemetry(filepath, False, str(ex)) - return results - def _send_telemetry(self, filepath: Path, success: bool, error: str): encryption_attempt = FileEncryptionTelem(str(filepath), success, error) self._telemetry_messenger.send_telemetry(encryption_attempt)