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.

(cherry picked from commit ccce74cf7b)
pull/27315/head
Jason Tibbitts 7 years ago committed by Toshio Kuratomi
parent 2385e2be27
commit 0a7bad68dc

@ -347,7 +347,7 @@ def ensure(module, base, state, names):
# 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
@ -374,7 +374,7 @@ def ensure(module, base, state, names):
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))

Loading…
Cancel
Save