Agent: Improve exception catching logic in process list collection PBA

This commit is contained in:
Shreya Malviya 2022-02-14 12:35:01 +05:30
parent fcfa01223d
commit 7cee2e49a2
1 changed files with 2 additions and 2 deletions

View File

@ -8,11 +8,11 @@ from infection_monkey.post_breach.pba import PBA
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
# Linux doesn't have WindowsError # Linux doesn't have WindowsError
applicable_exceptions = None applicable_exceptions = psutil.AccessDenied
try: try:
applicable_exceptions = (psutil.AccessDenied, WindowsError) applicable_exceptions = (psutil.AccessDenied, WindowsError)
except NameError: except NameError:
applicable_exceptions = psutil.AccessDenied pass
class ProcessListCollection(PBA): class ProcessListCollection(PBA):