Pr4/3 ;) add apt.sources_file operation#1597
Open
maisim wants to merge 3 commits intopyinfra-dev:3.xfrom
Open
Conversation
Contributor
Author
88b17c3 to
2bf2273
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
Creates /etc/apt/sources.list.d/<filename>.sources in modern deb822 format. Supports all standard fields (Types, URIs, Suites, Components, Architectures, Signed-By) and is idempotent via AptSources fact check. Removal (present=False) deletes the file; removal on absent file is a noop. Tests: create, create_idempotent, remove, remove_missing
2bf2273 to
4a5edee
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.
Creates /etc/apt/sources.list.d/.sources in modern deb822 format. Supports all standard fields (Types, URIs, Suites, Components, Architectures, Signed-By) and is idempotent via AptSources fact check.
Removal (present=False) deletes the file; removal on absent file is a noop.
Tests: create, create_idempotent, remove, remove_missing
3.xat this time)scripts/dev-test.sh)scripts/dev-lint.sh)