Ensure that we are handling DownloadError properly in the dnf module (#83543)

Signed-off-by: Roberto Alfieri <ralfieri@redhat.com>
pull/83578/head
rebtoor 3 months ago committed by GitHub
parent 28cef00576
commit 7cf7dff3a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,2 @@
bugfixes:
- dnf - Ensure that we are handling DownloadError properly in the dnf module

@ -1197,10 +1197,8 @@ class DnfModule(YumDnf):
self.base.download_packages(self.base.transaction.install_set)
except dnf.exceptions.DownloadError as e:
self.module.fail_json(
msg="Failed to download packages: {0}".format(to_text(e)),
results=[],
)
failure_response['msg'] = "Failed to download packages: {0}".format(to_native(e))
self.module.fail_json(**failure_response)
# Validate GPG. This is NOT done in dnf.Base (it's done in the
# upstream CLI subclass of dnf.Base)

Loading…
Cancel
Save