mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-10 08:38:28 +00:00
fix: [misp export] fix empty event on module start
This commit is contained in:
parent
194ae960fc
commit
5fab2326e6
1 changed files with 2 additions and 5 deletions
|
@ -319,11 +319,7 @@ 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
|
self.event_id = - 1
|
||||||
try:
|
|
||||||
self.event_id = self.get_daily_event_id()
|
|
||||||
except MISPConnectionError:
|
|
||||||
self.event_id = - 1
|
|
||||||
self.date = datetime.date.today()
|
self.date = datetime.date.today()
|
||||||
|
|
||||||
def export(self, obj, tag):
|
def export(self, obj, tag):
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue