From 13a0142e73c7e04eab4f0e1bd655f203f4483770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Fri, 3 Mar 2023 11:07:22 +0100 Subject: [PATCH] Remove validation for image type and format This is supposed to catch invalid values when creating metadata, but doesn't work particularly well. The validation is applied at parsing time too, causing breakage when new type/format is added but users haven't yet upgraded. --- productmd/images.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/productmd/images.py b/productmd/images.py index cede5ae..b75d514 100644 --- a/productmd/images.py +++ b/productmd/images.py @@ -68,6 +68,7 @@ "UniqueImage", ) +# Deprecated IMAGE_TYPE_FORMAT_MAPPING = { 'boot': ['iso'], 'cd': ['iso'], @@ -105,10 +106,10 @@ 'vsphere-ova': ['vsphere.ova'], } -#: supported image types +#: Deprecated. supported image types SUPPORTED_IMAGE_TYPES = list(sorted(IMAGE_TYPE_FORMAT_MAPPING.keys())) -#: supported image formats, they match with file suffix +#: Deprecated. supported image formats, they match with file suffix SUPPORTED_IMAGE_FORMATS = list(sorted(set(chain(*IMAGE_TYPE_FORMAT_MAPPING.values())))) #: combination of attributes which uniquely identifies an image across composes @@ -267,11 +268,9 @@ def _validate_volume_id(self): def _validate_type(self): self._assert_type("type", list(six.string_types)) - self._assert_value("type", SUPPORTED_IMAGE_TYPES) def _validate_format(self): self._assert_type("format", list(six.string_types)) - self._assert_value("format", SUPPORTED_IMAGE_FORMATS) def _validate_arch(self): self._assert_type("arch", list(six.string_types))