From e9a363bfded5600ab0f99da53999851f6fdc9eba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Wed, 24 Jul 2019 13:45:27 +0200 Subject: [PATCH] Fix shadowed variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This could result in incorrect log messages being printed. Signed-off-by: Lubomír Sedlář --- pungi/phases/createrepo.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pungi/phases/createrepo.py b/pungi/phases/createrepo.py index 0af51ccb..ad1443d9 100644 --- a/pungi/phases/createrepo.py +++ b/pungi/phases/createrepo.py @@ -289,13 +289,15 @@ def get_productids_from_scm(compose): # use for development: # pem_files = glob.glob("%s/*.pem" % tmp_dir)[-1:] if not pem_files: - msg = "No product certificate found (arch: %s, variant: %s)" % (arch, variant.uid) + warning = "No product certificate found (arch: %s, variant: %s)" % ( + arch, variant.uid + ) if product_id_allow_missing: - compose.log_warning(msg) + compose.log_warning(warning) continue else: shutil.rmtree(tmp_dir) - raise RuntimeError(msg) + raise RuntimeError(warning) if len(pem_files) > 1: shutil.rmtree(tmp_dir) raise RuntimeError("Multiple product certificates found (arch: %s, variant: %s): %s" % (arch, variant.uid, ", ".join(sorted([os.path.basename(i) for i in pem_files]))))