Pr3/3 manage apt key removal#1487
Open
maisim wants to merge 2 commits intopyinfra-dev:3.xfrom
Open
Conversation
Contributor
Author
|
WIP, I messed up the rebase of this branch... I'll continue at the end of the week. |
2602657 to
c9e83ad
Compare
5 tasks
74fe55e to
926fbfb
Compare
Contributor
Author
|
Just did add, update, remove repos tests in real life test (on a bookworm VM). Operations and Facts worked has expected. |
926fbfb to
97a6ebc
Compare
Contributor
Author
97a6ebc to
88b85a8
Compare
…mand - Update AptKeys fact to use GpgKeyrings instead of deprecated apt-key command - Maintain backward compatibility by flattening keyring data to match old format - Search APT-specific directories: /etc/apt/trusted.gpg.d, /etc/apt/keyrings, /usr/share/keyrings - Add comprehensive test coverage for modernized apt.key operations - Support both legacy and modern APT key management workflows
- Rename _sanitize_apt_keyring_name → _sanitize_keyring_part (cleaner name) - Remove dead 'dest' param from _derive_dest_from_src_and_keyids - Expose APT_KEYRING_DIRS constant at module level - Convert apt.key docstring to pyinfra '+' format - Fix present=False + keyid without dest: delegate directly to gpg.key._inner(working_dirs=APT_KEYRING_DIRS) instead of resolving a wrong default dest - Fix AptKeys.command() signature: directories=None with APT defaults as fallback, keeping LSP-compatible interface - Add collision comment in AptKeys.process() (last keyring wins on same ID) - Remove dead apt.AptKeys/gpg.GpgKey facts from test fixtures (apt.key delegates to gpg.key._inner, never calls those facts directly) - Fix _tempfile_ path placeholder in keyserver fixtures - Rewrite add_exists/add_keyserver_exists as true idempotent fixtures (file/keys already present → commands: []) - Delete add_no_gpg and add_keyserver_multiple_partial (untestable or superseded) - Add remove_file, remove_file_missing, remove_by_keyid fixtures
88b85a8 to
4777b9c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors and modernizes the APT repository and key management logic in
src/pyinfra/facts/apt.pyand related files. supporting both legacy and deb822 repository formats, and updating keyring handling to use modern GPG infrastructure.Follow #1465
3.xat this time)scripts/dev-test.sh)scripts/dev-lint.sh)