Skip to content

Commit 9550f86

Browse files
Birger SchachtBirger Schacht
authored andcommitted
Make the harmonization attribute of the bot private
that way we can exclude it from attribute listings of the bots attributes.
1 parent e489bee commit 9550f86

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

intelmq/lib/bot.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ class Bot(object):
108108
# Collectors with an empty process() should set this to true, prevents endless loops (#1364)
109109
__collector_empty_process: bool = False
110110

111+
_harmonization: dict = {}
112+
111113
def __init__(self, bot_id: str, start: bool = False, sighup_event=None,
112114
disable_multithreading: bool = None):
113115

@@ -241,6 +243,10 @@ def catch_shutdown():
241243
if start:
242244
self.start()
243245

246+
@property
247+
def harmonization(self):
248+
return self._harmonization
249+
244250
def __handle_sigterm_signal(self, signum: int, stack: Optional[object]):
245251
"""
246252
Calls when a SIGTERM is received. Stops the bot.
@@ -815,7 +821,7 @@ def __log_configuration_parameter(self, config_name: str, option: str, value: An
815821

816822
def __load_harmonization_configuration(self):
817823
self.logger.debug("Loading Harmonization configuration from %r.", HARMONIZATION_CONF_FILE)
818-
self.harmonization = utils.load_configuration(HARMONIZATION_CONF_FILE)
824+
self._harmonization = utils.load_configuration(HARMONIZATION_CONF_FILE)
819825

820826
def new_event(self, *args, **kwargs):
821827
return libmessage.Event(*args, harmonization=self.harmonization, **kwargs)

0 commit comments

Comments
 (0)