Update dnf5 module to handle API change for setting the download directory. Fixes #80887 (#80888)

This commit is contained in:
Matt Martz
2023-05-25 11:13:38 -05:00
committed by GitHub
parent 0775e991d5
commit 09387eaa24
2 changed files with 6 additions and 1 deletions

View File

@ -0,0 +1,3 @@
bugfixes:
- dnf5 - Update dnf5 module to handle API change for setting the download directory
(https://github.com/ansible/ansible/issues/80887)

View File

@ -513,6 +513,8 @@ class Dnf5Module(YumDnf):
conf.installroot = self.installroot
conf.use_host_config = True # needed for installroot
conf.cacheonly = self.cacheonly
if self.download_dir:
conf.destdir = self.download_dir
base.setup()
@ -667,7 +669,7 @@ class Dnf5Module(YumDnf):
if results:
msg = "Check mode: No changes made, but would have if not in check mode"
else:
transaction.download(self.download_dir or "")
transaction.download()
if not self.download_only:
if not self.disable_gpg_check and not transaction.check_gpg_signatures():
self.module.fail_json(