From bbf58068f57cc61252f3e2311d56525580a40601 Mon Sep 17 00:00:00 2001 From: Davlet Panech Date: Thu, 8 Aug 2024 11:05:06 -0400 Subject: [PATCH] downloader: fix logger exception When DEB version in a package list file is not valid/doesn't match the DEB file, downloader attempts to print a warning, but fails because logger format string has a typo. This results in a Python exception. Solution: fix the log message's format stirng TESTS ======================== * Reproduce the problem by adding a bad package version to one of the DEB list files in stx-tools * Re-run downloader with a fix and make sure the warning is printed correctly. Closes-Bug: 2076268 Change-Id: Ib2f34528c7382374dadffcc1ee0bb77dc1614c84 Signed-off-by: Davlet Panech --- build-tools/stx/downloader | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-tools/stx/downloader b/build-tools/stx/downloader index d2776783..9940d833 100755 --- a/build-tools/stx/downloader +++ b/build-tools/stx/downloader @@ -412,12 +412,12 @@ class DebDownloader(BaseDownloader): url_dict = utils.deb_file_name_to_dict(os.path.basename(url).replace("%2B", "+")) logger.debug("dkg_data: name=%s, ver=%s, url=%s, url_dict=%s, file=%s", pkg_name, pkg_ver, url, str(url_dict), list_file) if url_dict['ver'] and url_dict['ver'] != pkg_ver: - logger.warning("Package version mismatch for package %s, $s vs %s, in file %s", pkg_name, pkg_ver, url_dict['ver'], list_file) + logger.warning("Package version mismatch for package %s, %s vs %s, in file %s", pkg_name, pkg_ver, url_dict['ver'], list_file) pkg_ver = url_dict['ver'] if url_dict['epoch'] and url_dict['epoch'] != pkg_epoch: logger.warning("Package epoch mismatch for package %s, $s vs %s, in file %s", pkg_name, pkg_epoch, url_dict['epoch'], list_file) pkg_epoch = url_dict['epoch'] - + # Get arch from filename arch = pathlib.Path(url).stem.split("_")[-1] else: