Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension bots: check for executable wrong #2559

Open
sebix opened this issue Jan 28, 2025 · 0 comments
Open

Extension bots: check for executable wrong #2559

sebix opened this issue Jan 28, 2025 · 0 comments
Labels
bug Indicates an unexpected problem or unintended behavior component: core

Comments

@sebix
Copy link
Member

sebix commented Jan 28, 2025

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.

@sebix sebix added bug Indicates an unexpected problem or unintended behavior component: core labels Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior component: core
Projects
None yet
Development

No branches or pull requests

1 participant