From 20005adb982aafba6effedb5d79e68767b70b0ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Wed, 12 Apr 2017 10:43:24 +0200 Subject: [PATCH] comps-wrapper: Return IDs instead of yum.comps.Group MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We never need anything more than the ID, so passing around a big complicated object is not necessary. Signed-off-by: Lubomír Sedlář --- pungi/phases/gather/sources/source_comps.py | 2 +- pungi/wrappers/comps.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pungi/phases/gather/sources/source_comps.py b/pungi/phases/gather/sources/source_comps.py index b9992080..69ba9e3a 100644 --- a/pungi/phases/gather/sources/source_comps.py +++ b/pungi/phases/gather/sources/source_comps.py @@ -46,5 +46,5 @@ class GatherSourceComps(pungi.phases.gather.source.GatherSourceBase): comps.filter_groups(variant.groups) for i in comps.get_comps_groups(): - groups.add(i.groupid) + groups.add(i) return set(), groups diff --git a/pungi/wrappers/comps.py b/pungi/wrappers/comps.py index 39e63e38..cc18a990 100644 --- a/pungi/wrappers/comps.py +++ b/pungi/wrappers/comps.py @@ -45,7 +45,8 @@ class CompsWrapper(object): self.comps_file = comps_file def get_comps_groups(self): - return self.comps.get_groups() + """Return a list of group IDs.""" + return [group.groupid for group in self.comps.get_groups()] def write_comps(self, comps_obj=None, target_file=None): if not comps_obj: