Skip to content

Commit

Permalink
Merge pull request #2531 from certtools/2530-shadowserver-parser-atte…
Browse files Browse the repository at this point in the history
…mpts-to-download-schema-even-if-not-configured

Fix to avoid schema download if not configured #2530.
  • Loading branch information
sebix authored Nov 4, 2024
2 parents d5e3e41 + 629412a commit e8fdd2a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#### Parsers
- `intelmq.bots.parsers.shadowserver._config`:
- fix error message formatting if schema file is absent (PR#2528 by Sebastian Wagner).
- `intelmq.bots.parsers.shadowserver.parser`:
- Fix to avoid schema download if not configured #2530.

#### Experts

Expand Down
21 changes: 12 additions & 9 deletions intelmq/bots/parsers/shadowserver/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,15 +261,18 @@ def run(cls, parsed_args=None):
else:
logger.setLevel('ERROR')
config.set_logger(logger)
if config.update_schema():
runtime_conf = utils.get_bots_settings()
try:
ctl = IntelMQController()
for bot in runtime_conf:
if runtime_conf[bot]["module"] == __name__:
ctl.bot_reload(bot)
except Exception as e:
logger.error("Failed to signal bot: %r" % str(e))
runtime_conf = utils.get_bots_settings()
try:
ctl = IntelMQController()
bots = []
for bot in runtime_conf:
if runtime_conf[bot]["module"] == __name__:
bots.append(bot)
if len(bots) and config.update_schema():
for bot in bots:
ctl.bot_reload(bot)
except Exception as e:
logger.error("Failed to update: %r" % str(e))
else:
super().run(parsed_args=parsed_args)

Expand Down

0 comments on commit e8fdd2a

Please sign in to comment.