diff --git a/pungi/phases/buildinstall.py b/pungi/phases/buildinstall.py index 5cf40217..c66e6d45 100644 --- a/pungi/phases/buildinstall.py +++ b/pungi/phases/buildinstall.py @@ -364,6 +364,7 @@ def link_boot_iso(compose, arch, variant): img.disc_number = 1 img.disc_count = 1 img.bootable = True + img.subvariant = variant.name img.implant_md5 = implant_md5 try: img.volume_id = iso.get_volume_id(new_boot_iso_path) diff --git a/pungi/phases/createiso.py b/pungi/phases/createiso.py index ec41221c..f88b20de 100644 --- a/pungi/phases/createiso.py +++ b/pungi/phases/createiso.py @@ -299,6 +299,7 @@ class CreateIsoThread(WorkerThread): img.disc_number = cmd["disc_num"] img.disc_count = cmd["disc_count"] img.bootable = cmd["bootable"] + img.subvariant = str(cmd['variant']) img.implant_md5 = iso.get_implanted_md5(cmd["iso_path"]) try: img.volume_id = iso.get_volume_id(cmd["iso_path"]) diff --git a/pungi/phases/image_build.py b/pungi/phases/image_build.py index cc50e371..f1272a01 100644 --- a/pungi/phases/image_build.py +++ b/pungi/phases/image_build.py @@ -229,6 +229,7 @@ class CreateImageBuildThread(WorkerThread): img.disc_number = 1 # We don't expect multiple disks img.disc_count = 1 img.bootable = False + img.subvariant = cmd["image_conf"]["image-build"]["variant"] compose.im.add(variant=cmd["image_conf"]["image-build"]["variant"].uid, arch=image_info['arch'], image=img) diff --git a/pungi/phases/live_images.py b/pungi/phases/live_images.py index 99ed5c98..8ec40b69 100644 --- a/pungi/phases/live_images.py +++ b/pungi/phases/live_images.py @@ -122,6 +122,7 @@ class LiveImagesPhase(PhaseBase): for variant in self.compose.variants.values(): for arch in variant.arches + ["src"]: for data in get_arch_variant_data(self.compose.conf, "live_images", arch, variant): + subvariant = data.get('subvariant', variant.uid) type = data.get('type', 'live') if type == 'live': @@ -136,7 +137,7 @@ class LiveImagesPhase(PhaseBase): continue cmd = { - "name": data.get("name", None), + "name": data.get('name'), "version": data.get("version", None), "release": self._get_release(data), "dest_dir": dest_dir, @@ -153,6 +154,7 @@ class LiveImagesPhase(PhaseBase): "sign": False, "type": type, "label": "", # currently not used + "subvariant": subvariant, } if 'ksurl' in data: @@ -217,12 +219,18 @@ class CreateLiveImageThread(WorkerThread): self.basename = '%(name)s-%(version)s-%(release)s' % cmd log_file = compose.paths.log.log_file(arch, "liveimage-%s" % self.basename) + subvariant = cmd.pop('subvariant') + + imgname = "%s-%s-%s-%s" % (compose.ci_base.release.short, subvariant, + 'Live' if cmd['type'] == 'live' else 'Disk', + arch) + msg = "Creating ISO (arch: %s, variant: %s): %s" % (arch, variant, self.basename) self.pool.log_info("[BEGIN] %s" % msg) koji_wrapper = KojiWrapper(compose.conf["koji_profile"]) - name, version = compose.compose_id.rsplit("-", 1) - name = cmd["name"] or name + _, version = compose.compose_id.rsplit("-", 1) + name = cmd["name"] or imgname version = cmd["version"] or version archive = False if cmd["specfile"] and not cmd["scratch"]: @@ -278,11 +286,11 @@ class CreateLiveImageThread(WorkerThread): # ISO manifest only makes sense for live images self._write_manifest(destination) - self._add_to_images(compose, variant, arch, cmd['type'], self._get_format(image_path), destination) + self._add_to_images(compose, variant, subvariant, arch, cmd['type'], self._get_format(image_path), destination) self.pool.log_info("[DONE ] %s" % msg) - def _add_to_images(self, compose, variant, arch, type, format, path): + def _add_to_images(self, compose, variant, subvariant, arch, type, format, path): """Adds the image to images.json""" img = Image(compose.im) img.type = 'raw-xz' if type == 'appliance' else type @@ -294,6 +302,7 @@ class CreateLiveImageThread(WorkerThread): img.disc_number = 1 # We don't expect multiple disks img.disc_count = 1 img.bootable = True + img.subvariant = subvariant compose.im.add(variant=variant.uid, arch=arch, image=img) def _is_image(self, path): diff --git a/pungi/phases/livemedia_phase.py b/pungi/phases/livemedia_phase.py index c5f3ec27..e0ea5215 100644 --- a/pungi/phases/livemedia_phase.py +++ b/pungi/phases/livemedia_phase.py @@ -127,8 +127,10 @@ class LiveMediaPhase(PhaseBase): def run(self): for variant in self.compose.get_variants(): arches = set([x for x in variant.arches if x != 'src']) - for image_conf in get_variant_data(self.compose.conf, self.name, variant): + subvariant = image_conf.get('subvariant', variant.uid) + name = image_conf.get( + 'name', "%s-%s-Live" % (self.compose.ci_base.release.short, subvariant)) config = { 'target': self._get_config(image_conf, 'target'), 'arches': self._get_arches(image_conf, arches), @@ -138,7 +140,8 @@ class LiveMediaPhase(PhaseBase): 'scratch': image_conf.get('scratch', False), 'release': self._get_release(image_conf), 'skip_tag': image_conf.get('skip_tag'), - 'name': image_conf['name'], + 'name': name, + 'subvariant': subvariant, 'title': image_conf.get('title'), 'repo': self._get_repos(image_conf, variant), 'install_tree': self._get_install_tree(image_conf, variant), @@ -189,6 +192,7 @@ class LiveMediaThread(WorkerThread): ' '.join(config['arches']), variant.uid) self.pool.log_info('[BEGIN] %s' % msg) + subvariant = config.pop('subvariant') koji_wrapper = KojiWrapper(compose.conf['koji_profile']) cmd = self._get_cmd(koji_wrapper, config) @@ -236,6 +240,7 @@ class LiveMediaThread(WorkerThread): img.disc_number = 1 # We don't expect multiple disks img.disc_count = 1 img.bootable = True + img.subvariant = subvariant compose.im.add(variant=variant.uid, arch=image_info['arch'], image=img) self.pool.log_info('[DONE ] %s' % msg)