Skip to content

Commit 51077a5

Browse files
authored
Merge pull request #2523 from sebix/fix-2521
Shadowserver: Fix parameter 'reports' behaviour if empty string
2 parents a9f6c6e + b322bc5 commit 51077a5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

intelmq/bots/collectors/shadowserver/collector_reports_api.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class ShadowServerAPICollectorBot(CollectorBot, HttpMixin, CacheMixin):
2929
Parameters:
3030
api_key (str): Your Shadowserver API key
3131
secret (str): Your Shadowserver API secret
32-
country (str): DEPRECIATED The mailing list you want to download reports for (i.e. 'austria')
32+
country (str): DEPRECATED The mailing list you want to download reports for (i.e. 'austria')
3333
reports (list):
3434
A list of strings or a comma-separated list of the mailing lists you want to process.
3535
types (list):
@@ -56,7 +56,9 @@ def init(self):
5656
raise ValueError('No secret provided.')
5757

5858
if isinstance(self.reports, str):
59-
self._report_list = self.reports.split(',')
59+
# if reports is an empty string (or only contains whitespace), behave as if the parameter is not set and select all reports
60+
reports = self.reports.strip()
61+
self._report_list = reports.split(',') if reports else []
6062
elif isinstance(self.reports, list):
6163
self._report_list = self.reports
6264
if isinstance(self.types, str):

0 commit comments

Comments
 (0)