Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
superstes committed Nov 2, 2024
1 parent 1b90081 commit 2e940ec
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ def report() -> Response:

out_file = RISK_REPORT_DIR / f'{datetime.now().strftime("%Y-%m-%d")}_{gethostname()}.txt'
with report_lock:
with open(out_file, 'a+', encoding='utf-8') as f:
f.write(json_dumps(r) + '\n')
with open(out_file, 'a+', encoding='utf-8') as fo:
fo.write(json_dumps(r) + '\n')

return _response_json(code=200, data={'msg': 'Reported'})

Expand Down Expand Up @@ -182,6 +182,7 @@ def check_net(ip) -> Response:
net = f"{net}/{NET_SIZE[ipv]}"

try:
# pylint: disable=E0606
return _response_json(code=200, data={**NET_DATA[ipv][net], 'network': net})

except KeyError:
Expand All @@ -194,6 +195,7 @@ def check_asn(nr) -> Response:
return _response_json(code=400, data={'msg': 'Invalid ASN provided'})

try:
# pylint: disable=E0606
return _response_json(code=200, data=ASN_DATA[str(nr)])

except KeyError:
Expand Down

0 comments on commit 2e940ec

Please sign in to comment.