fix: Avoiding dictionary indexes issues

- Using tuples as a dictionary indexes is better
  than using generators...
pull/304/head
chrisr3d 2019-05-20 09:19:38 +02:00
parent 0d5f867825
commit 54f5fa6fa9
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
1 changed files with 1 additions and 1 deletions

View File

@ -91,7 +91,7 @@ class JoeParser():
connections = defaultdict(list)
for packet in network[protocol]['packet']:
timestamp = self.parse_timestamp(packet['timestamp'])
connections[(packet[field] for field in fields)].append(datetime.strptime(timestamp, '%B %d, %Y %H:%M:%S.%f'))
connections[tuple(packet[field] for field in fields)].append(datetime.strptime(timestamp, '%B %d, %Y %H:%M:%S.%f'))
for connection, timestamps in connections.items():
network_connection_object = MISPObject('network-connection')
for field, value in zip(fields, connection):