Skip to content

Commit 4f6ef0f

Browse files
committed
asn, fake expert: use state path for database default
1 parent d5f87d6 commit 4f6ef0f

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ Please refer to the [NEWS](NEWS.md) for a list of changes which have an affect o
2929
- `intelmq.bots.parsers.cymru.parser_cap_program`: Add mapping for TOR and ipv6-icmp protocol (PR#2621 by Mikk Margus Möll).
3030

3131
#### Experts
32-
- `intelmq.bots.experts.asn_lookup.expert`: Print URLs to stdout only in verbose mode (PR#2591 by Sebastian Wagner).
32+
- `intelmq.bots.experts.asn_lookup.expert`:
33+
- Print URLs to stdout only in verbose mode (PR#2591 by Sebastian Wagner).
34+
- Use database path matching to installation type (PR#2606 by Sebastian Wagner).
35+
- `intelmq.bots.experts.fake.expert`: Use database path matching to installation type (PR#2606 by Sebastian Wagner).
3336

3437
#### Outputs
3538

intelmq/bots/experts/asn_lookup/expert.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import pathlib
1212
import requests
1313

14+
from intelmq import VAR_STATE_PATH
1415
from intelmq.lib.bot import ExpertBot
1516
from intelmq.lib.exceptions import MissingDependencyError
1617
from intelmq.lib.utils import get_bots_settings, create_request_session
@@ -25,7 +26,7 @@
2526

2627
class ASNLookupExpertBot(ExpertBot):
2728
"""Add ASN and netmask information from a local BGP dump"""
28-
database = None # TODO: should be pathlib.Path
29+
database: str = f'{VAR_STATE_PATH}asn_lookup/ipasn.dat' # TODO: should be pathlib.Path
2930
autoupdate_cached_database: bool = True # Activate/deactivate update-database functionality
3031

3132
def init(self):

intelmq/bots/experts/fake/expert.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
from json import load as json_load
88

99
from intelmq.lib.bot import ExpertBot
10+
from intelmq import VAR_STATE_PATH
1011

1112

1213
class FakeExpertBot(ExpertBot):
1314
"""Add fake data"""
1415

1516
overwrite: bool = False
16-
database: str = None # TODO: should be pathlib.Path
17+
database: str = f'{VAR_STATE_PATH}fake/data.json' # TODO: should be pathlib.Path
1718

1819
def init(self):
1920
with open(self.database) as database:

0 commit comments

Comments
 (0)