From 34197628306b584e1b3ceeab47aa0ff889ecb371 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Thu, 30 Aug 2018 14:36:34 +0200 Subject: [PATCH] extra_iso: Set unified flag in metadata MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will avoid conflict in productmd that two images share the same attributes. JIRA: COMPOSE-2908 Signed-off-by: Lubomír Sedlář --- pungi/phases/createiso.py | 5 ++++- pungi/phases/extra_isos.py | 4 +++- tests/test_extra_isos_phase.py | 6 +++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/pungi/phases/createiso.py b/pungi/phases/createiso.py index 40ca27a0..6c48b30e 100644 --- a/pungi/phases/createiso.py +++ b/pungi/phases/createiso.py @@ -226,7 +226,9 @@ class CreateIsoThread(WorkerThread): variant=str(variant)) -def add_iso_to_metadata(compose, variant, arch, iso_path, bootable, disc_num, disc_count): +def add_iso_to_metadata( + compose, variant, arch, iso_path, bootable, disc_num, disc_count, unified=False +): img = Image(compose.im) img.path = iso_path.replace(compose.paths.compose.topdir(), '').lstrip('/') img.mtime = get_mtime(iso_path) @@ -240,6 +242,7 @@ def add_iso_to_metadata(compose, variant, arch, iso_path, bootable, disc_num, di img.bootable = bootable img.subvariant = variant.uid img.implant_md5 = iso.get_implanted_md5(iso_path, logger=compose._logger) + img.unified = unified setattr(img, 'can_fail', compose.can_fail(variant, arch, 'iso')) setattr(img, 'deliverable', 'iso') try: diff --git a/pungi/phases/extra_isos.py b/pungi/phases/extra_isos.py index 527e24a0..a379b6e7 100644 --- a/pungi/phases/extra_isos.py +++ b/pungi/phases/extra_isos.py @@ -112,7 +112,9 @@ class ExtraIsosThread(WorkerThread): arch, "extraiso-%s" % os.path.basename(iso_path)), with_jigdo=False) - add_iso_to_metadata(compose, variant, arch, iso_path, bootable, 1, 1) + add_iso_to_metadata( + compose, variant, arch, iso_path, bootable, 1, 1, unified=True + ) self.pool.log_info("[DONE ] %s" % msg) diff --git a/tests/test_extra_isos_phase.py b/tests/test_extra_isos_phase.py index 4b7b5f43..c8a35e6e 100644 --- a/tests/test_extra_isos_phase.py +++ b/tests/test_extra_isos_phase.py @@ -147,7 +147,7 @@ class ExtraIsosThreadTest(helpers.PungiTestCase): aitm.call_args_list, [mock.call(compose, server, 'x86_64', os.path.join(self.topdir, 'compose/Server/x86_64/iso/my.iso'), - True, 1, 1)] + True, 1, 1, unified=True)] ) def test_binary_image_custom_naming(self, aitm, rcc, gef, gic, gfn, gvi): @@ -188,7 +188,7 @@ class ExtraIsosThreadTest(helpers.PungiTestCase): aitm.call_args_list, [mock.call(compose, server, 'x86_64', os.path.join(self.topdir, 'compose/Server/x86_64/iso/my.iso'), - False, 1, 1)] + False, 1, 1, unified=True)] ) def test_source_is_not_bootable(self, aitm, rcc, gef, gic, gfn, gvi): @@ -230,7 +230,7 @@ class ExtraIsosThreadTest(helpers.PungiTestCase): aitm.call_args_list, [mock.call(compose, server, 'src', os.path.join(self.topdir, 'compose/Server/source/iso/my.iso'), - False, 1, 1)] + False, 1, 1, unified=True)] ) def test_failable_failed(self, aitm, rcc, gef, gic, gfn, gvi):