Skip to content

fix(rpm-versionlock): warn when dnf5 lockfile unreadable on Python <3.11 (#1462) - #1490

Closed
AquaticAzelf wants to merge 1 commit into
Linuxfabrik:mainfrom
AquaticAzelf:fix/dnf5-tomllib-warn-1462
Closed

fix(rpm-versionlock): warn when dnf5 lockfile unreadable on Python <3.11 (#1462)#1490
AquaticAzelf wants to merge 1 commit into
Linuxfabrik:mainfrom
AquaticAzelf:fix/dnf5-tomllib-warn-1462

Conversation

@AquaticAzelf

Copy link
Copy Markdown

Fixes #1462

get_dnf5_locks() returned [],[],[] when tomllib is unavailable (Python <3.11) even if /etc/dnf/versionlock.toml exists, silently reporting OK.

  • check-plugins/rpm-versionlock/rpm-versionlock:568 now checks for the dnf5 lockfile existence when tomllib is None and returns [],[],["<lockfile> cannot be read, this needs Python 3.11 or newer"] via the ignored channel, which main() already treats as STATE_WARN and displays under "These configurations are read but applied to nothing".
  • A host without dnf5 (no lockfile) stays quiet.
  • check-plugins/rpm-versionlock/unit-test/run removes the NEEDS_TOMLLIB skip and makes those 7 testcases assert WARN with cannot be read, this needs Python 3.11 or newer when tomllib is missing, so the same tests pass on both old and new interpreters.

Verified folder-locally: python ./run passes (48 tests) on Python 3.14 and simulated tomllib=None correctly returns WARN for existing lockfile and OK for missing file.

@markuslf
markuslf self-requested a review August 28, 2026 07:10
@markuslf

Copy link
Copy Markdown
Member

Thanks for the PR. We have already fixed #1462 in be274bd

@markuslf markuslf closed this Aug 28, 2026
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.

rpm-versionlock: dnf 5 locks are silently reported as "no locks" on Python 3.10 and older

2 participants