diff --git a/pungi/phases/test.py b/pungi/phases/test.py index 5d3a483e..b4e87ab1 100644 --- a/pungi/phases/test.py +++ b/pungi/phases/test.py @@ -18,6 +18,7 @@ import os from pungi.phases.base import PhaseBase from pungi.util import failable, get_arch_variant_data +import productmd.compose class TestPhase(PhaseBase): @@ -25,6 +26,7 @@ class TestPhase(PhaseBase): def run(self): check_image_sanity(self.compose) + check_image_metadata(self.compose) def check_image_sanity(compose): @@ -45,6 +47,17 @@ def check_image_sanity(compose): check_size_limit(compose, variant, arch, img) +def check_image_metadata(compose): + """ + Check the images metadata for entries that cannot be serialized. + Often caused by isos with duplicate metadata. + Accessing the `images` attribute will raise an exception if there's a problem + """ + + compose = productmd.compose.Compose(compose.paths.compose.topdir()) + return compose.images + + def check_sanity(compose, variant, arch, image): path = os.path.join(compose.paths.compose.topdir(), image.path) deliverable = getattr(image, "deliverable")