From f6121f08870158664466231cd31dd9536307466c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Thu, 6 Apr 2017 08:24:03 +0200 Subject: [PATCH] unified-iso: Handle missing paths in metadata MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For empty variants the path is no longer stored, so we need to handle the possible exception. This has no effect on the actual result, as if the path was empty, we would bail anyway on missing .treeinfo. Signed-off-by: Lubomír Sedlář --- pungi_utils/unified_isos.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pungi_utils/unified_isos.py b/pungi_utils/unified_isos.py index 2f47159a..dfc0eda5 100644 --- a/pungi_utils/unified_isos.py +++ b/pungi_utils/unified_isos.py @@ -126,7 +126,11 @@ class UnifiedISO(object): for variant in self.ci.get_variants(recursive=False): for arch in variant.arches: print("Processing: {0}.{1}".format(variant.uid, arch)) - tree_dir = os.path.join(self.compose_path, variant.paths.os_tree[arch]) + try: + tree_dir = os.path.join(self.compose_path, variant.paths.os_tree[arch]) + except KeyError: + # The path in metadata is missing: no content there + continue ti = productmd.treeinfo.TreeInfo() try: