mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-12-23 04:31:56 +00:00
Improve handling of supervisor errors in ProcessManagingEventHandler
This commit is contained in:
parent
9b550f724d
commit
8588328a8f
@ -38,11 +38,10 @@ class ProcessManagingEventHandler(TriggerlessEventHandler):
|
||||
try:
|
||||
data = data_json['data']
|
||||
self.processmanager(data['command'], data['process_name'])
|
||||
data_json['data']['error'] = False
|
||||
return data_json
|
||||
except KeyError:
|
||||
log.error('IGNORING MESSAGE: Invalid data_json received: {}'.format(data_json))
|
||||
except SupervisorFault:
|
||||
data_json['data']['error'] = True
|
||||
except SupervisorFault as fault:
|
||||
data_json['data']['error'] = fault.faultString
|
||||
log.debug('Failed to execute command on process: {}'.format(data_json))
|
||||
return data_json
|
||||
|
Loading…
Reference in New Issue
Block a user