Skip to content

Allow ASN database update to create missing file - #2716

Open
0xTaoZ wants to merge 1 commit into
certtools:developfrom
0xTaoZ:codex/asn-update-create-db
Open

Allow ASN database update to create missing file#2716
0xTaoZ wants to merge 1 commit into
certtools:developfrom
0xTaoZ:codex/asn-update-create-db

Conversation

@0xTaoZ

@0xTaoZ 0xTaoZ commented Jul 13, 2026

Copy link
Copy Markdown

Summary

  • allow the ASN lookup expert database updater to create a missing configured database file
  • keep validation for existing paths that are directories/non-files or unwritable files
  • add a focused regression test for the missing-file update path

Rationale

--update-database already creates the parent directory before writing the downloaded ASN database, but it currently rejects the configured database path if the file does not already exist. This makes first-time updates fail unless users manually pre-create the file.

Fixes #2689.

Validation

  • .venv/bin/python -m pytest --no-cov intelmq/tests/bots/experts/asn_lookup/test_expert.py -q
  • git diff --check

Risk

Low. Existing database files still need to be writable, and existing non-file paths are rejected before download/write.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

asn expert database update fails if file does not already exist

1 participant