diff --git a/intelmq/lib/utils.py b/intelmq/lib/utils.py index 78e6ed7ff..5701db1af 100644 --- a/intelmq/lib/utils.py +++ b/intelmq/lib/utils.py @@ -855,7 +855,7 @@ def _get_console_entry_points(): def get_bot_module_name(bot_name: str) -> str: entries = entry_points() if hasattr(entries, "select"): - entries = entries.select(name=bot_name, group="console_scripts") + entries = tuple(entries.select(name=bot_name, group="console_scripts")) else: entries = [entry for entry in entries.get("console_scripts", []) if entry.name == bot_name] diff --git a/intelmq/tests/lib/test_utils.py b/intelmq/tests/lib/test_utils.py index 48b54032e..b99a50138 100644 --- a/intelmq/tests/lib/test_utils.py +++ b/intelmq/tests/lib/test_utils.py @@ -350,6 +350,8 @@ def test_get_bot_module_name_builtin_bot(self): found_name = utils.get_bot_module_name("intelmq.bots.collectors.api.collector_api") self.assertEqual("intelmq.bots.collectors.api.collector_api", found_name) + self.assertIsNone(utils.get_bot_module_name("intelmq.not-existing-bot")) + def test_get_bots_settings(self): with unittest.mock.patch.object(utils, "get_runtime", new_get_runtime): runtime = utils.get_bots_settings()