From 63bd9de7448eb13c7a30883757352d6e6e8a1df0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Wed, 4 Jan 2017 15:18:56 +0100 Subject: [PATCH] metadata: Correctly parse lorax .treeinfo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Productmd does validation on the parsed value. There is a long list of rules to populate `short` name in the productmd code. There is a shim in pungi to make sure the short is populated if no rule matches. After renaming product to release, the shim stopped working. Signed-off-by: Lubomír Sedlář --- pungi/metadata.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pungi/metadata.py b/pungi/metadata.py index 7ae82d8e..b4681828 100644 --- a/pungi/metadata.py +++ b/pungi/metadata.py @@ -265,15 +265,15 @@ def write_tree_info(compose, arch, variant, timestamp=None): ti.checksums.add(repomd_path, "sha256", root_dir=os_tree) class LoraxProduct(productmd.treeinfo.Release): - def _check_short(self): + def _validate_short(self): # HACK: set self.short so .treeinfo produced by lorax can be read if not self.short: self.short = compose.conf["release_short"] class LoraxTreeInfo(productmd.treeinfo.TreeInfo): - def clear(self): - super(LoraxTreeInfo, self).clear() - self.product = LoraxProduct(self) + def __init__(self, *args, **kwargs): + super(LoraxTreeInfo, self).__init__(*args, **kwargs) + self.release = LoraxProduct(self) # images if variant.type == "variant":