Repository navigation
chore(apt): remove unused apt key listing code - #7113
Merged
Merged
Conversation
1 of 2 tasks
apt_key() implemented 'list' and 'finger' commands next to 'add', but nothing calls them: add_apt_key_raw() is the only caller of apt_key() and it only ever adds keys. Rather than fix the listing logic, which assumes every file under /etc/apt/trusted.gpg.d/ is a keyring, drop it together with GPG.list_keys(), which only existed to serve it. Fixes canonicalGH-5333
wak327
force-pushed
the
chore/remove-unused-apt-key-list
branch
from
September 30, 2026 20:10
19caaf7 to
f2a3348
Compare
nryanl
approved these changes
Oct 6, 2026
nryanl
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for picking this up! Looks good to me.
Contributor
Author
|
Thanks for the review @nryanl! The CI workflows haven't run on this PR yet, they're all waiting for maintainer approval since this is my first contribution to cloud-init. @nryanl @holmanb could one of you approve the workflow runs here and on #7114, #7115, #7116, #7122 and #7123? The CLA check should pass now that I've signed it. |
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.
Proposed Commit Message
Additional Context
Fixes #5333
This follows the suggestion in GH-5333 to delete the code rather than fix it. The only call site of
apt_key()passes"add", and nothing else usesGPG.list_keys().APT_LOCAL_KEYSstays becausetests/integration_tests/modules/test_apt_functionality.pystill uses it.apt_key()now raisesValueErrorfor any command other than"add", and a new test covers this.test_kill_gpg_succeedsonly calledlist_keys()to "start" gpg, so it now callsdearmor()for that instead.Verified with the pinned black, isort, ruff, pylint and mypy, and the full unit suite passes (5,775 tests).
Test Steps
Merge type