From 7b699662da1cb0437161b5168e9475b909f6aca7 Mon Sep 17 00:00:00 2001 From: Lubomír Sedlář Date: Dec 17 2019 07:08:13 +0000 Subject: Accept missing images.json Latest Pungi does not write this file at all if there is no image in the compose. Let the scripts survive this. JIRA: COMPOSE-4043 --- diff --git a/compose_utils/changelog.py b/compose_utils/changelog.py index 958a519..5399cb1 100644 --- a/compose_utils/changelog.py +++ b/compose_utils/changelog.py @@ -249,7 +249,10 @@ class ComposeChangelog(object): dicts. """ imgs = {} - imgdict = compose.images.images + try: + imgdict = compose.images.images + except RuntimeError: + return imgs for variant in imgdict: for arch in imgdict[variant]: for img in imgdict[variant][arch]: diff --git a/compose_utils/copy_compose.py b/compose_utils/copy_compose.py index 57d6137..07d358f 100644 --- a/compose_utils/copy_compose.py +++ b/compose_utils/copy_compose.py @@ -87,8 +87,8 @@ def _collect_variant(compose, variant, arch=None): else: for vararch_images in variant_images.values(): images.extend(vararch_images) - except KeyError: - # Ignore no images in the variant/arch combination. + except (RuntimeError, KeyError): + # Ignore no images in the variant/arch combination or at all. pass for image in images: if not arch or image.arch == arch: