diff --git a/docs/user/bots.rst b/docs/user/bots.rst index ae17cbf55..6c1e65759 100644 --- a/docs/user/bots.rst +++ b/docs/user/bots.rst @@ -1622,7 +1622,7 @@ The report configuration is stored in a `shadowserver-schema.json` file download The parser will attempt to download a schema update on startup when the *auto_update* option is enabled. -Schema downloads can also be scheduled as a cron job: +Schema downloads can also be scheduled as a cron job for the `intelmq` user: .. code-block:: bash diff --git a/intelmq/bots/parsers/shadowserver/_config.py b/intelmq/bots/parsers/shadowserver/_config.py index 178bd0869..c53c1276d 100644 --- a/intelmq/bots/parsers/shadowserver/_config.py +++ b/intelmq/bots/parsers/shadowserver/_config.py @@ -102,6 +102,7 @@ class __Container: __config.schema_active = __config.schema_file __config.schema_mtime = 0.0 __config.auto_update = False +__config.test_mode = False __config.feedname_mapping = {} __config.filename_mapping = {} @@ -113,6 +114,7 @@ def set_logger(logger): def enable_test_mode(enable): """ Set which schema to load. """ + __config.test_mode = enable if enable: __config.schema_active = __config.schema_base else: @@ -317,8 +319,10 @@ def reload(): mtime = os.path.getmtime(__config.schema_file) if __config.schema_mtime == mtime: return + elif __config.test_mode: + return else: - __config.logger.info("The schema file does not exist.") + raise ValueError("The schema file does not exist.") if __config.schema_mtime == 0.0 and mtime == 0.0 and __config.auto_update: update_schema()