Skip to content

Commit 61c756d

Browse files
committed
Added exception for missing schema and added intelmq user to the crontab suggestion.
1 parent a0b34cb commit 61c756d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

docs/user/bots.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1622,7 +1622,7 @@ The report configuration is stored in a `shadowserver-schema.json` file download
16221622

16231623
The parser will attempt to download a schema update on startup when the *auto_update* option is enabled.
16241624

1625-
Schema downloads can also be scheduled as a cron job:
1625+
Schema downloads can also be scheduled as a cron job for the `intelmq` user:
16261626

16271627
.. code-block:: bash
16281628

intelmq/bots/parsers/shadowserver/_config.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ class __Container:
102102
__config.schema_active = __config.schema_file
103103
__config.schema_mtime = 0.0
104104
__config.auto_update = False
105+
__config.test_mode = False
105106
__config.feedname_mapping = {}
106107
__config.filename_mapping = {}
107108

@@ -113,6 +114,7 @@ def set_logger(logger):
113114

114115
def enable_test_mode(enable):
115116
""" Set which schema to load. """
117+
__config.test_mode = enable
116118
if enable:
117119
__config.schema_active = __config.schema_base
118120
else:
@@ -318,7 +320,8 @@ def reload():
318320
if __config.schema_mtime == mtime:
319321
return
320322
else:
321-
__config.logger.info("The schema file does not exist.")
323+
if not __config.test_mode:
324+
raise ValueError("The schema file does not exist.")
322325

323326
if __config.schema_mtime == 0.0 and mtime == 0.0 and __config.auto_update:
324327
update_schema()

0 commit comments

Comments
 (0)