fix Subprocessor now writes an error if it fails to process the data

This commit is contained in:
Colombo 2020-06-24 11:44:58 +04:00
parent ddb6bcf416
commit d78ec338c6

View file

@ -226,8 +226,12 @@ class Subprocessor(object):
cli.state = 0
elif op == 'error':
#some error occured while process data, returning chunk to on_data_return
err_msg = obj.get('err_msg', None)
if err_msg is not None:
io.log_info(f'Error while processing data: {err_msg}')
if 'data' in obj.keys():
self.on_data_return (cli.host_dict, obj['data'] )
self.on_data_return (cli.host_dict, obj['data'] )
#and killing process
cli.kill()
self.clis.remove(cli)