From e7104a445b0f3135004ff4d7832adc8575a94776 Mon Sep 17 00:00:00 2001 From: ivovangeel Date: Tue, 27 Nov 2018 00:08:36 +0100 Subject: [PATCH] Fix incorrect 'installed' status setting in dnf.py (#48931) --- lib/ansible/modules/packaging/os/dnf.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/ansible/modules/packaging/os/dnf.py b/lib/ansible/modules/packaging/os/dnf.py index 3bf36f95f4d..48087b67f0f 100644 --- a/lib/ansible/modules/packaging/os/dnf.py +++ b/lib/ansible/modules/packaging/os/dnf.py @@ -340,11 +340,10 @@ class DnfModule(YumDnf): result['nevra'] = '{epoch}:{name}-{version}-{release}.{arch}'.format( **result) - # Added for YUM3/YUM4 compat - if package.repoid == 'installed': - result['yumstate'] = 'installed' - else: + if package.installtime == 0: result['yumstate'] = 'available' + else: + result['yumstate'] = 'installed' return result