Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dnf: add more specific error message for GPG check #76194

Merged
merged 1 commit into from Nov 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/76192-dnf-specific-gpg-error.yml
@@ -0,0 +1,2 @@
minor_changes:
- dnf - add more specific error message for GPG validation (https://github.com/ansible/ansible/issues/76192)
2 changes: 1 addition & 1 deletion lib/ansible/modules/dnf.py
Expand Up @@ -1298,7 +1298,7 @@ def ensure(self):
fail = True

if fail:
msg = 'Failed to validate GPG signature for {0}'.format(package)
msg = 'Failed to validate GPG signature for {0}: {1}'.format(package, gpgerr)
self.module.fail_json(msg)

if self.download_only:
Expand Down
1 change: 1 addition & 0 deletions test/integration/targets/dnf/tasks/gpg.yml
Expand Up @@ -57,6 +57,7 @@
that:
- res is failed
- "'Failed to validate GPG signature' in res.msg"
- "'is not signed' in res.msg"

always:
- name: Remove rpm-sign (and test package if it got installed)
Expand Down