Skip to content

Extension bots: check for executable wrong #2559

@sebix

Description

@sebix

intelmqctl check checks if all bots have their executables in $PATH so they can be started:

for group in utils.list_all_bots().values():
for bot_id, bot in group.items():
if subprocess.call(['which', bot['module']], stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL):
check_logger.error('Incomplete installation: Executable %r for %r not found in $PATH (%r).',
bot['module'], bot_id, os.getenv('PATH'))

The list of bots is generated by

bots[module_name.split('.')[2].capitalize()[:-1]][name] = {
"module": mod.__name__,
"description": "Missing description" if not getattr(mod.BOT, '__doc__', None) else textwrap.dedent(mod.BOT.__doc__).strip(),
"parameters": keys,
}

The module used here is not the entry point/executable, but the module that's behind the entry point.

For example, if the extension bot is packaged as mybots.bots.experts.example and the entrypoint and executable is intelmq.bots.experts.example, then the check searches for the executable mybots.bots.experts.example instead of intelmq.bots.experts.example.

I think "module": bot.name would be correct.

Metadata

Metadata

Assignees

Labels

bugIndicates an unexpected problem or unintended behaviorcomponent: core

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions