Skip to content

Commit

Permalink
Fix exception after reload by using _internal variable names only.
Browse files Browse the repository at this point in the history
  • Loading branch information
wagner-intevation committed Jun 20, 2022
1 parent bc6ca6f commit f7dca45
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
intelmq-certbund-contact (0.9.6-1) unstable; urgency=medium

* Fix exception after reload by using _internal variable names only.

-- Sebastian Wagner <[email protected]> Mon, 20 Jun 2022 14:59:55 +0200

intelmq-certbund-contact (0.9.5-1) unstable; urgency=medium

* IntelMQ 3.0 compatibility.
Expand Down
20 changes: 10 additions & 10 deletions intelmq/bots/experts/certbund_rules/expert.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,23 @@ class CERTBundRuleExpertBot(Bot):
sections: str = "source"

def init(self):
self.sections = [section.strip() for section in
self.sections.split(",")]
self.logger.debug("Sections: %r", self.sections)

self.entry_points = load_scripts(self.script_directory,
"determine_directives",
logger=self.logger)
if not self.entry_points:
self._sections = [section.strip() for section in
self.sections.split(",")]
self.logger.debug("Sections: %r", self._sections)

self._entry_points = load_scripts(self.script_directory,
"determine_directives",
logger=self.logger)
if not self._entry_points:
self.logger.warning("No rules loaded.")

def process(self):
event = self.receive_message()

for section in self.sections:
for section in self._sections:
context = Context(event, section, self.logger)
self.logger.debug("Calling scripts for section %r.", section)
for entry in self.entry_points:
for entry in self._entry_points:
self.logger.debug("Calling script %r.", entry.filename)
try:
finished = entry(context)
Expand Down

0 comments on commit f7dca45

Please sign in to comment.