dnf5: avoid generating excessive history entries (#85065)

Fixes #85046

(cherry picked from commit cff49a62ec)
pull/85101/head
Martin Krizek 7 months ago committed by Matt Martz
parent dcec78b0f9
commit 0aab250fbc
No known key found for this signature in database
GPG Key ID: 40832D88E9FC91D8

@ -0,0 +1,2 @@
bugfixes:
- dnf5 - avoid generating excessive transaction entries in the dnf5 history (https://github.com/ansible/ansible/issues/85046)

@ -797,7 +797,7 @@ class Dnf5Module(YumDnf):
if self.module.check_mode:
if results:
msg = "Check mode: No changes made, but would have if not in check mode"
else:
elif changed:
transaction.download()
if not self.download_only:
transaction.set_description("ansible dnf5 module")

@ -19,6 +19,9 @@
assert:
that:
- "'results' in dnf_result"
- shell: dnf history list | wc -l
register: dnf_history_lines_before
# ============================================================================
- name: Install dinginessentail-1.0-1 again
dnf:
@ -40,6 +43,13 @@
assert:
that:
- "'msg' in dnf_result"
- shell: dnf history list | wc -l
register: dnf_history_lines_after
- assert:
that:
- dnf_history_lines_before.stdout == dnf_history_lines_after.stdout
# ============================================================================
- name: Install dinginessentail again (noop, module is idempotent)
dnf:

Loading…
Cancel
Save