extra_iso: Add list of variants to metadata

The main variant is already available, this patch adds information about
additional variants that are included in the image.

JIRA: COMPOSE-2917
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2018-09-27 14:50:47 +02:00
parent 1aff7fc3ac
commit aab2fc4519
3 changed files with 20 additions and 6 deletions

View File

@ -227,7 +227,14 @@ class CreateIsoThread(WorkerThread):
def add_iso_to_metadata( def add_iso_to_metadata(
compose, variant, arch, iso_path, bootable, disc_num, disc_count, unified=False compose,
variant,
arch,
iso_path,
bootable,
disc_num=1,
disc_count=1,
additional_variants=None,
): ):
img = Image(compose.im) img = Image(compose.im)
img.path = iso_path.replace(compose.paths.compose.topdir(), '').lstrip('/') img.path = iso_path.replace(compose.paths.compose.topdir(), '').lstrip('/')
@ -242,7 +249,9 @@ def add_iso_to_metadata(
img.bootable = bootable img.bootable = bootable
img.subvariant = variant.uid img.subvariant = variant.uid
img.implant_md5 = iso.get_implanted_md5(iso_path, logger=compose._logger) img.implant_md5 = iso.get_implanted_md5(iso_path, logger=compose._logger)
img.unified = unified if additional_variants:
img.unified = True
img.additional_variants = additional_variants
setattr(img, 'can_fail', compose.can_fail(variant, arch, 'iso')) setattr(img, 'can_fail', compose.can_fail(variant, arch, 'iso'))
setattr(img, 'deliverable', 'iso') setattr(img, 'deliverable', 'iso')
try: try:

View File

@ -113,7 +113,12 @@ class ExtraIsosThread(WorkerThread):
with_jigdo=False) with_jigdo=False)
add_iso_to_metadata( add_iso_to_metadata(
compose, variant, arch, iso_path, bootable, 1, 1, unified=True compose,
variant,
arch,
iso_path,
bootable,
additional_variants=config["include_variants"],
) )
self.pool.log_info("[DONE ] %s" % msg) self.pool.log_info("[DONE ] %s" % msg)

View File

@ -147,7 +147,7 @@ class ExtraIsosThreadTest(helpers.PungiTestCase):
aitm.call_args_list, aitm.call_args_list,
[mock.call(compose, server, 'x86_64', [mock.call(compose, server, 'x86_64',
os.path.join(self.topdir, 'compose/Server/x86_64/iso/my.iso'), os.path.join(self.topdir, 'compose/Server/x86_64/iso/my.iso'),
True, 1, 1, unified=True)] True, additional_variants=["Client"])]
) )
def test_binary_image_custom_naming(self, aitm, rcc, gef, gic, gfn, gvi): 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, aitm.call_args_list,
[mock.call(compose, server, 'x86_64', [mock.call(compose, server, 'x86_64',
os.path.join(self.topdir, 'compose/Server/x86_64/iso/my.iso'), os.path.join(self.topdir, 'compose/Server/x86_64/iso/my.iso'),
False, 1, 1, unified=True)] False, additional_variants=["Client"])]
) )
def test_source_is_not_bootable(self, aitm, rcc, gef, gic, gfn, gvi): 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, aitm.call_args_list,
[mock.call(compose, server, 'src', [mock.call(compose, server, 'src',
os.path.join(self.topdir, 'compose/Server/source/iso/my.iso'), os.path.join(self.topdir, 'compose/Server/source/iso/my.iso'),
False, 1, 1, unified=True)] False, additional_variants=["Client"])]
) )
def test_failable_failed(self, aitm, rcc, gef, gic, gfn, gvi): def test_failable_failed(self, aitm, rcc, gef, gic, gfn, gvi):