Add try/except to system info collection so agent doesn't crash if exception is encountered

This commit is contained in:
Shreya 2021-03-18 13:30:18 +05:30
parent a83c97519c
commit 91577c6464
1 changed files with 6 additions and 3 deletions

View File

@ -252,9 +252,12 @@ class InfectionMonkey(object):
def collect_system_info_if_configured(self): def collect_system_info_if_configured(self):
LOG.debug("Calling for system info collection") LOG.debug("Calling for system info collection")
system_info_collector = SystemInfoCollector() try:
system_info = system_info_collector.get_info() system_info_collector = SystemInfoCollector()
SystemInfoTelem(system_info).send() system_info = system_info_collector.get_info()
SystemInfoTelem(system_info).send()
except Exception as e:
LOG.exception(f"Exception encountered during system info collection: {str(e)}")
def shutdown_by_not_alive_config(self): def shutdown_by_not_alive_config(self):
if not WormConfiguration.alive: if not WormConfiguration.alive: