Update from upstream #11
@ -18,6 +18,7 @@ import os
|
|||||||
|
|
||||||
from pungi.phases.base import PhaseBase
|
from pungi.phases.base import PhaseBase
|
||||||
from pungi.util import failable, get_arch_variant_data
|
from pungi.util import failable, get_arch_variant_data
|
||||||
|
import productmd.compose
|
||||||
|
|
||||||
|
|
||||||
class TestPhase(PhaseBase):
|
class TestPhase(PhaseBase):
|
||||||
@ -25,6 +26,7 @@ class TestPhase(PhaseBase):
|
|||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
check_image_sanity(self.compose)
|
check_image_sanity(self.compose)
|
||||||
|
check_image_metadata(self.compose)
|
||||||
|
|
||||||
|
|
||||||
def check_image_sanity(compose):
|
def check_image_sanity(compose):
|
||||||
@ -45,6 +47,17 @@ def check_image_sanity(compose):
|
|||||||
check_size_limit(compose, variant, arch, img)
|
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):
|
def check_sanity(compose, variant, arch, image):
|
||||||
path = os.path.join(compose.paths.compose.topdir(), image.path)
|
path = os.path.join(compose.paths.compose.topdir(), image.path)
|
||||||
deliverable = getattr(image, "deliverable")
|
deliverable = getattr(image, "deliverable")
|
||||||
|
Loading…
Reference in New Issue
Block a user