fix: [misp export] fix empty event on module start

This commit is contained in:
terrtia 2024-01-30 11:45:43 +01:00
parent 194ae960fc
commit 5fab2326e6
No known key found for this signature in database
GPG key ID: 1E1B1F50D84613D0

View file

@ -319,10 +319,6 @@ class MISPExporterAutoDaily(MISPExporter):
def __init__(self, url='', key='', ssl=False): def __init__(self, url='', key='', ssl=False):
super().__init__(url=url, key=key, ssl=ssl) super().__init__(url=url, key=key, ssl=ssl)
# create event if don't exists
try:
self.event_id = self.get_daily_event_id()
except MISPConnectionError:
self.event_id = - 1 self.event_id = - 1
self.date = datetime.date.today() self.date = datetime.date.today()
@ -345,6 +341,7 @@ class MISPExporterAutoDaily(MISPExporter):
self.add_event_object(self.event_id, obj) self.add_event_object(self.event_id, obj)
except MISPConnectionError: except MISPConnectionError:
self.event_id = - 1
return -1 return -1