Skip to content

Commit 629412a

Browse files
committed
Fix to avoid schema download if not configured #2530.
1 parent d5e3e41 commit 629412a

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#### Parsers
2424
- `intelmq.bots.parsers.shadowserver._config`:
2525
- fix error message formatting if schema file is absent (PR#2528 by Sebastian Wagner).
26+
- `intelmq.bots.parsers.shadowserver.parser`:
27+
- Fix to avoid schema download if not configured #2530.
2628

2729
#### Experts
2830

intelmq/bots/parsers/shadowserver/parser.py

+12-9
Original file line numberDiff line numberDiff line change
@@ -261,15 +261,18 @@ def run(cls, parsed_args=None):
261261
else:
262262
logger.setLevel('ERROR')
263263
config.set_logger(logger)
264-
if config.update_schema():
265-
runtime_conf = utils.get_bots_settings()
266-
try:
267-
ctl = IntelMQController()
268-
for bot in runtime_conf:
269-
if runtime_conf[bot]["module"] == __name__:
270-
ctl.bot_reload(bot)
271-
except Exception as e:
272-
logger.error("Failed to signal bot: %r" % str(e))
264+
runtime_conf = utils.get_bots_settings()
265+
try:
266+
ctl = IntelMQController()
267+
bots = []
268+
for bot in runtime_conf:
269+
if runtime_conf[bot]["module"] == __name__:
270+
bots.append(bot)
271+
if len(bots) and config.update_schema():
272+
for bot in bots:
273+
ctl.bot_reload(bot)
274+
except Exception as e:
275+
logger.error("Failed to update: %r" % str(e))
273276
else:
274277
super().run(parsed_args=parsed_args)
275278

0 commit comments

Comments
 (0)