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

FIX: prevent jinja expert bot crash on logrotate #2420

Merged
merged 1 commit into from
Nov 14, 2023

Conversation

monoidic
Copy link
Contributor

@monoidic monoidic commented Nov 1, 2023

This PR prevents this error on logrotate, which appears to be caused by init getting rerun after self.fields has already been updated by init?

Jinja-Expert - ERROR - Bot initialization failed.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/intelmq/lib/bot.py", line 241, in __init__
    self.init()
  File "/usr/lib/python3/dist-packages/intelmq/bots/experts/jinja/expert.py", line 38, in init
    if not template.startswith("file:///"):
AttributeError: 'Template' object has no attribute 'startswith'

Copy link
Contributor

@kamil-certat kamil-certat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the change, LGTM!

which appears to be caused by init getting rerun after self.fields has already been updated by init?

This is typical situation on reloading the bot, when the process isn't stopped (as during the restart), and init() is expected to refresh the configuration

@sebix sebix merged commit df26d61 into certtools:develop Nov 14, 2023
24 checks passed
@sebix
Copy link
Member

sebix commented Nov 14, 2023

Merged, based on kamil's review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants