From 7cee2e49a21112a0ed91cfcfea0f77bab943a36c Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Mon, 14 Feb 2022 12:35:01 +0530 Subject: [PATCH] Agent: Improve exception catching logic in process list collection PBA --- .../post_breach/actions/collect_processes_list.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monkey/infection_monkey/post_breach/actions/collect_processes_list.py b/monkey/infection_monkey/post_breach/actions/collect_processes_list.py index c83faf9b3..7e9e1b059 100644 --- a/monkey/infection_monkey/post_breach/actions/collect_processes_list.py +++ b/monkey/infection_monkey/post_breach/actions/collect_processes_list.py @@ -8,11 +8,11 @@ from infection_monkey.post_breach.pba import PBA logger = logging.getLogger(__name__) # Linux doesn't have WindowsError -applicable_exceptions = None +applicable_exceptions = psutil.AccessDenied try: applicable_exceptions = (psutil.AccessDenied, WindowsError) except NameError: - applicable_exceptions = psutil.AccessDenied + pass class ProcessListCollection(PBA):