From ac3c227af8e5096803b75962d23c16cad8939ee0 Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Sat, 8 Feb 2025 10:14:08 +0100 Subject: [PATCH] list_all_bots: use bot name as module Fix check for bot executable in $PATH by using the bot name instead of the import path fixes https://github.com/certtools/intelmq/issues/2559 --- CHANGELOG.md | 3 ++- intelmq/lib/utils.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e6553ca0b..4682ff07c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ @@ -13,6 +13,7 @@ ### Core - Python 3.8 or newer is required (PR#2541 by Sebastian Wagner). +- `intelmq.lib.utils.list_all_bots`/`intelmqctl check`: Fix check for bot executable in $PATH by using the bot name instead of the import path (fixes #2559, PR#2564 by Sebastian Wagner). ### Development diff --git a/intelmq/lib/utils.py b/intelmq/lib/utils.py index de59a223a..c97e1184c 100644 --- a/intelmq/lib/utils.py +++ b/intelmq/lib/utils.py @@ -913,7 +913,7 @@ def list_all_bots() -> dict: name = name.replace(bot_type, '') bots[module_name.split('.')[2].capitalize()[:-1]][name] = { - "module": mod.__name__, + "module": bot.name, "description": "Missing description" if not getattr(mod.BOT, '__doc__', None) else textwrap.dedent(mod.BOT.__doc__).strip(), "parameters": keys, }