Skip to content

Commit

Permalink
[stable-2.15] Update dnf5 module to handle API change for setting the…
Browse files Browse the repository at this point in the history
… download directory. Fixes #80887 (#80888) (#80889)

(cherry picked from commit 09387ea)
  • Loading branch information
sivel committed May 25, 2023
1 parent 6b1ba18 commit 94b97c9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changelogs/fragments/80887-dnf5-api-change.yml
Original file line number Diff line number Diff line change
@@ -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)
4 changes: 3 additions & 1 deletion lib/ansible/modules/dnf5.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,8 @@ def run(self):
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()

Expand Down Expand Up @@ -667,7 +669,7 @@ def run(self):
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(
Expand Down

0 comments on commit 94b97c9

Please sign in to comment.