From a99bf8c828f77ae13fd274887429c507916eaff1 Mon Sep 17 00:00:00 2001 From: Pat Riehecky Date: Mon, 19 Aug 2019 11:15:49 -0500 Subject: [PATCH] Store the parsed variants for possible later re-use Merges: https://pagure.io/pungi/pull-request/1257 Signed-off-by: Pat Riehecky --- pungi/wrappers/variants.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pungi/wrappers/variants.py b/pungi/wrappers/variants.py index a7fa7998..b039a7d8 100755 --- a/pungi/wrappers/variants.py +++ b/pungi/wrappers/variants.py @@ -60,6 +60,7 @@ class VariantsXmlParser(object): with open(get_variants_dtd(logger), 'r') as f: self.dtd = lxml.etree.DTD(f) self.addons = {} + self.variants = {} self.layered_products = {} self.tree_arches = tree_arches self.tree_variants = tree_variants @@ -228,14 +229,13 @@ class VariantsXmlParser(object): variant_id = str(variant_node.attrib["id"]) self.addons[variant_id] = variant_node - result = {} for variant_node in self.tree.xpath("/variants/variant[@type='variant']"): variant = self.parse_variant_node(variant_node) if not variant or self._is_excluded(variant): continue - result[variant.id] = variant + self.variants[variant.id] = variant - return result + return self.variants class Variant(object):