chg: More flexible when an event is in a weird state.

pull/551/head
Raphaël Vinot 2020-02-05 13:28:11 +01:00
parent a1e96731b2
commit 337d9a6306
1 changed files with 6 additions and 2 deletions

View File

@ -63,8 +63,12 @@ if __name__ == '__main__':
counter = 1
total = len(events)
for event in events:
e = misp.get_event(event.uuid, pythonify=True)
e_feed = e.to_feed(valid_distributions=valid_attribute_distributions, with_meta=True)
try:
e = misp.get_event(event.uuid, pythonify=True)
e_feed = e.to_feed(valid_distributions=valid_attribute_distributions, with_meta=True)
except Exception as e:
print(e, event.uuid)
continue
if not e_feed:
print(f'Invalid distribution {e.distribution}, skipping')
continue