Skip to content

Commit 5c91a8c

Browse files
Sebastian WagnerWagner
authored andcommitted
bug: lib/bots: fix names of private attributes
Make private members `__is_multithreadable` and `__collector_empty_process` protected members `_is_multithreadable` and `_collector_empty_process` to make them easily modifiable by Bot classes fixes #2108
1 parent d396543 commit 5c91a8c

File tree

11 files changed

+28
-17
lines changed

11 files changed

+28
-17
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ CHANGELOG
1111

1212
### Core
1313
- `intelmq.lib.bot.CollectorBot`: Fixed an issue with within the `new_report` function, which re-loads the harmonization file after a new incoming dataset, which leads to CPU drain and decreased performance (PR#2106 by Sebastian Waldbauer, fixes #2098).
14+
- `intelmq.lib.bot.Bot`: Make private members `__is_multithreadable` and `__collector_empty_process` protected members `_is_multithreadable` and `_collector_empty_process` to make them easily modifiable by Bot classes (PR#2109 by Sebastian Wagner, fixes #2108).
15+
Also affected and adapted bots by this change are:
16+
- `intelmq.bots.collectors.api.collector_api`
17+
- `intelmq.bots.collectors.stomp.collector`
18+
- `intelmq.bots.experts.splunk_saved_search.expert`
19+
- `intelmq.bots.experts.threshold.expert`
20+
- `intelmq.bots.outputs.file.output`
21+
- `intelmq.bots.outputs.misp.output_api`
22+
- `intelmq.bots.outputs.misp.output_feed`
23+
- `intelmq.bots.outputs.tcp.output`
24+
- `intelmq.bots.outputs.udp.output`
1425

1526
### Bots
1627
#### Experts

intelmq/bots/collectors/api/collector_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ class APICollectorBot(CollectorBot):
3737
"""Collect data by exposing a HTTP API interface"""
3838
name: str = "API"
3939
port: int = 5000
40-
__collector_empty_process: bool = True
40+
_collector_empty_process: bool = True
4141
provider: str = "APICollector"
42-
__is_multithreadable: bool = False
42+
_is_multithreadable: bool = False
4343
use_socket = False
4444
socket_path = '/tmp/imq_api_default_socket'
4545
_server: Optional['HTTPServer'] = None

intelmq/bots/collectors/stomp/collector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class StompCollectorBot(CollectorBot):
6969
ssl_client_certificate_key: str = 'client.key' # TODO pathlib.Path
7070
heartbeat: int = 6000
7171

72-
__collector_empty_process: bool = True
72+
_collector_empty_process: bool = True
7373
__conn = False # define here so shutdown method can check for it
7474

7575
def init(self):

intelmq/bots/experts/splunk_saved_search/expert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class SplunkSavedSearchBot(Bot):
8282
search_parameters = {"event field": "search parameter"}
8383
url: str = None
8484

85-
__is_multithreadable = False
85+
_is_multithreadable = False
8686

8787
def init(self):
8888
if requests is None:

intelmq/bots/experts/threshold/expert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class ThresholdExpertBot(Bot, CacheMixin):
6868

6969
_message_processed_verb = 'Forwarded'
7070

71-
__is_multithreadable = False
71+
_is_multithreadable = False
7272
bypass = False
7373

7474
def init(self):

intelmq/bots/outputs/file/output.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class FileOutputBot(OutputBot):
2222
message_jsondict_as_string: bool = False
2323
message_with_type: bool = False
2424
single_key: bool = False
25-
__is_multithreadable = False
25+
_is_multithreadable = False
2626

2727
def init(self):
2828
# needs to be done here, because in process() FileNotFoundError handling we call init(),

intelmq/bots/outputs/misp/output_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class MISPAPIOutputBot(OutputBot):
9595
misp_url: str = None
9696
significant_fields: list = []
9797

98-
_Bot__is_multithreadable = False
98+
_is_multithreadable = False
9999

100100
def init(self):
101101
if pymisp is None and import_fail_reason == 'syntax':

intelmq/bots/outputs/misp/output_feed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class MISPFeedOutputBot(OutputBot):
3535
misp_org_name = None
3636
misp_org_uuid = None
3737
output_dir: str = "/opt/intelmq/var/lib/bots/mispfeed-output" # TODO: should be path
38-
__is_multithreadable: bool = False
38+
_is_multithreadable: bool = False
3939

4040
@staticmethod
4141
def check_output_dir(dirname):

intelmq/bots/outputs/tcp/output.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class TCPOutputBot(Bot):
2525
port: int = None
2626
separator: str = None
2727

28-
__is_multithreadable = False
28+
_is_multithreadable = False
2929

3030
def init(self):
3131
self.to_intelmq = self.counterpart_is_intelmq

intelmq/bots/outputs/udp/output.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class UDPOutputBot(Bot):
1919
udp_host: str = "localhost"
2020
udp_port: int = None
2121

22-
__is_multithreadable = False
22+
_is_multithreadable = False
2323

2424
def init(self):
2525
self.delimiter = self.field_delimiter

0 commit comments

Comments
 (0)