compose: Stop duplicating variant types

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2017-05-03 14:40:32 +02:00
parent c784dab4aa
commit ad120f2608

View File

@ -235,9 +235,8 @@ class Compose(kobo.log.LoggingBase):
def get_variants(self, types=None, arch=None):
result = []
types = types or ["variant", "optional", "addon", "layered-product"]
for i in self.variants.itervalues():
if i.type in types and (not arch or arch in i.arches):
if (not types or i.type in types) and (not arch or arch in i.arches):
result.append(i)
result.extend(i.get_variants(types=types, arch=arch))
return sorted(set(result))