From 0529742705113672cd3a6d0bd0b089f3b4af2bea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Mon, 4 Nov 2024 10:35:27 +0100 Subject: [PATCH] Publish: Fix for missing image --- c2cciutils/scripts/publish.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/c2cciutils/scripts/publish.py b/c2cciutils/scripts/publish.py index 629c1828..f3db17aa 100644 --- a/c2cciutils/scripts/publish.py +++ b/c2cciutils/scripts/publish.py @@ -401,8 +401,8 @@ def main() -> None: for image in images_src: _, versions_image = c2cciutils.lib.docker.get_dpkg_packages_versions(image) for dpkg_package, package_version in versions_image.items(): - if dpkg_package not in current_versions_in_images[image]: - current_versions_in_images[image][dpkg_package] = str(package_version) + if dpkg_package not in current_versions_in_images.get(image, {}): + current_versions_in_images.setdefault(image, {})[dpkg_package] = str(package_version) for dpkg_package in list(current_versions_in_images[image].keys()): if dpkg_package not in versions_image: del current_versions_in_images[image][dpkg_package]