From ccce74cf7b1dd109918044a3f806989d64d40d6b Mon Sep 17 00:00:00 2001 From: Jason Tibbitts Date: Tue, 25 Jul 2017 17:01:51 -0500 Subject: [PATCH] Avoid using deprecated group_install API DNF's base.group_install() function accepts a string as its first argument. Prior to DNF-2, compatibility code existed which allowed this function to accept a base.comps.Group object instead. That is no longer possible. Pass "group.id" to base.group_install() instead of "group" to work around this. --- lib/ansible/modules/packaging/os/dnf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/packaging/os/dnf.py b/lib/ansible/modules/packaging/os/dnf.py index d49d7a6472..395fcc8a71 100644 --- a/lib/ansible/modules/packaging/os/dnf.py +++ b/lib/ansible/modules/packaging/os/dnf.py @@ -375,7 +375,7 @@ def ensure(module, base, state, names, autoremove): # Install groups. for group in groups: try: - base.group_install(group, dnf.const.GROUP_PACKAGE_TYPES) + base.group_install(group.id, dnf.const.GROUP_PACKAGE_TYPES) except dnf.exceptions.Error as e: # In dnf 2.0 if all the mandatory packages in a group do # not install, an error is raised. We want to capture @@ -402,7 +402,7 @@ def ensure(module, base, state, names, autoremove): base.group_upgrade(group) except dnf.exceptions.CompsError: # If not already installed, try to install. - base.group_install(group, dnf.const.GROUP_PACKAGE_TYPES) + base.group_install(group.id, dnf.const.GROUP_PACKAGE_TYPES) except dnf.exceptions.Error as e: failures.append((group, e))