From 7c12df582301a99f3d2e877f3c63e69581da5f8e Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Mon, 11 Mar 2024 16:06:00 -0500 Subject: [PATCH] Fix error message when a package isn't available (#1024) The original behavior was to raise a KeyError with the missing package name, but this was regressed to an assert with no actionable error message by a previous change. Fixes 09a78f4 --- ros_buildfarm/common.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ros_buildfarm/common.py b/ros_buildfarm/common.py index 1347818ca..319d524af 100644 --- a/ros_buildfarm/common.py +++ b/ros_buildfarm/common.py @@ -175,6 +175,8 @@ def get_binary_package_versions(apt_cache, debian_pkg_names): pkg = apt_cache.get(debian_pkg_name) if not pkg: prov = apt_cache.get_providing_packages(debian_pkg_name) + if not prov: + raise KeyError("No packages available for '%s'" % (debian_pkg_name,)) assert len(prov) == 1 pkg = apt_cache[prov[0]] versions[debian_pkg_name] = max(pkg.versions).version