Skip to content

Commit 0aa6d6f

Browse files
committed
Updated to reset report type on reload #2361
1 parent dd0b35c commit 0aa6d6f

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

intelmq/bots/parsers/shadowserver/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ The report configuration is now stored in a _schema.json_ file downloaded from h
1111

1212
For environments that have internet connectivity the `update_schema.py` script should be setup as a cron job to obtain the latest revision.
1313

14-
For air-gapped systems automation will be required to download and copy the _schema.json_ file into this directory
14+
For air-gapped systems automation will be required to download and copy the _schema.json_ file into this directory.
1515

1616
The parser will automatically reload the configuration when the file changes.

intelmq/bots/parsers/shadowserver/_config.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,15 +272,14 @@ def scan_exchange_identifier(field):
272272
def reload ():
273273
""" reload the configuration if it has changed """
274274
mtime = 0.0
275+
schema_file = __config.schema_file
275276

276-
if (os.path.isfile(__config.schema_file)):
277+
if os.path.isfile(__config.schema_file):
277278
mtime = os.path.getmtime(__config.schema_file)
278279
if __config.schema_mtime == mtime:
279280
return
280-
schema_file = __config.schema_file
281281
else:
282282
# load a test schema if one has not been downloaded yet
283-
schema_file = __config.schema_file
284283
schema_file += '.test'
285284

286285
__config.feedname_mapping.clear()

intelmq/bots/parsers/shadowserver/parser.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,5 +220,8 @@ def parse_line(self, row, report):
220220

221221
yield event
222222

223+
def shutdown(self):
224+
self.feedname = None
225+
223226

224227
BOT = ShadowserverParserBot

0 commit comments

Comments
 (0)