Blob Blame History Raw
From 8b7b4f65bb443cff1aa263cf7af44c9ec3243fb8 Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
Date: Thu, 8 Oct 2020 12:57:10 -0700
Subject: [PATCH] Pass package_types to dnf base group_install as tuple, not
 set

I believe this is probably the cause of
https://bugzilla.redhat.com/show_bug.cgi?id=1886567 , which broke
Rawhide and F33 composes today. dnf itself seems to always pass
this as a list or a tuple. The dnf API docs say "`pkg_types` is a
sequence of strings determining the kinds of packages to be
installed"; according to Python docs, lists, tuples and range
types are "sequences", but sets are not, so technically we are
out of bounds here. I believe this worked before this dnf commit:
https://github.com/rpm-software-management/dnf/commit/4d991f61
and upstream *could* probably tweak things to accept sets again,
but it seems reasonable to fix it here.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
---
 imgcreate/dnfinst.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/imgcreate/dnfinst.py b/imgcreate/dnfinst.py
index 06a5b24..8a74494 100644
--- a/imgcreate/dnfinst.py
+++ b/imgcreate/dnfinst.py
@@ -129,7 +129,7 @@ class DnfLiveCD(dnf.Base):
         elif include == GROUP_ALL:
             package_types.add('optional')
         try:
-            self.group_install(grp.id, package_types, exclude=exclude)
+            self.group_install(grp.id, tuple(package_types), exclude=exclude)
         except dnf.exceptions.CompsError as e:
             # DNF raises this when it is already selected
             pass
-- 
2.28.0