From d5f6812a080f5a792f05654635770c567c2a37fd Mon Sep 17 00:00:00 2001 From: Daniel Goldberg Date: Mon, 25 Sep 2017 15:32:13 +0300 Subject: [PATCH] Fix permission bug to work in non admin contexts. --- chaos_monkey/system_info/__init__.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/chaos_monkey/system_info/__init__.py b/chaos_monkey/system_info/__init__.py index b9a16d459..c95caa444 100644 --- a/chaos_monkey/system_info/__init__.py +++ b/chaos_monkey/system_info/__init__.py @@ -78,7 +78,19 @@ class InfoCollector(object): "cmdline": "ACCESS DENIED", "full_image_path": "null", } - pass + continue + except WindowsError: + # we may be running as non root + # and some processes are impossible to acquire in Windows/Linux + # in this case we'll just add what we can + processes[process.pid] = {"name": "null", + "pid": process.pid, + "ppid": process.ppid(), + "cmdline": "ACCESS DENIED", + "full_image_path": "null", + } + continue + self.info['process_list'] = processes def get_network_info(self):