netflow, make sure get_timeserie_data() returns string type objects in stead of bytes, to prevent 17e4e9c0fc (commitcomment-33587137)

we might find some other small type interpretation differences, but the bumpiest seems to be gone now.
This commit is contained in:
Ad Schellevis 2019-05-18 09:23:25 +02:00
parent 2bdc74b8a1
commit 28ed5741f4
2 changed files with 5 additions and 2 deletions

View File

@ -61,7 +61,7 @@ if __name__ == '__main__':
record_key = []
for key_field in cmd_args.key_fields.split(','):
if key_field in record and record[key_field] is not None:
record_key.append(str(record[key_field]))
record_key.append(record[key_field])
else:
record_key.append('')
record_key = ','.join(record_key)

View File

@ -267,7 +267,10 @@ class BaseFlowAggregator(object):
result_record = dict()
for field_indx in range(len(field_names)):
if len(record) > field_indx:
result_record[field_names[field_indx]] = record[field_indx]
if type(record[field_indx]) == bytes:
result_record[field_names[field_indx]] = record[field_indx].decode()
else:
result_record[field_names[field_indx]] = record[field_indx]
if 'start_time' in result_record:
result_record['end_time'] = result_record['start_time'] \
+ datetime.timedelta(seconds=self.resolution)