fix: Avoiding dictionary indexes issues

- Using tuples as a dictionary indexes is better
  than using generators...
pull/304/head
chrisr3d 3 years ago
parent 0d5f867825
commit 54f5fa6fa9
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
  1. 2
      misp_modules/modules/import_mod/joe_import.py

@ -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):

Loading…
Cancel
Save