Make sure we don't crash with bad telemetry
This commit is contained in:
Daniel Goldberg 2019-01-30 18:31:17 +02:00
parent 0a94cea5af
commit f5ba65d654
1 changed files with 1 additions and 1 deletions

View File

@ -35,7 +35,7 @@ class TelemetryFeed(flask_restful.Resource):
{ {
'id': telem['_id'], 'id': telem['_id'],
'timestamp': telem['timestamp'].strftime('%d/%m/%Y %H:%M:%S'), 'timestamp': telem['timestamp'].strftime('%d/%m/%Y %H:%M:%S'),
'hostname': NodeService.get_monkey_by_guid(telem['monkey_guid'])['hostname'], 'hostname': NodeService.get_monkey_by_guid(telem['monkey_guid']).get('hostname','missing'),
'brief': TELEM_PROCESS_DICT[telem['telem_type']](telem) 'brief': TELEM_PROCESS_DICT[telem['telem_type']](telem)
} }