From 1f313b39ad2790ecfd417021231533e24c693923 Mon Sep 17 00:00:00 2001 From: Daniel Mach Date: Thu, 23 Jul 2015 10:58:35 -0400 Subject: [PATCH] createiso: Add createiso_skip options to skip createiso on any variant/arch. --- doc/configuration.rst | 27 +++++++++++++++++++++++++++ pungi/phases/createiso.py | 15 ++++++++++++++- tests/data/dummy-pungi.conf | 9 +++++++++ 3 files changed, 50 insertions(+), 1 deletion(-) diff --git a/doc/configuration.rst b/doc/configuration.rst index 75218b6c..405a7e18 100644 --- a/doc/configuration.rst +++ b/doc/configuration.rst @@ -436,3 +436,30 @@ Example "branch": None, "dir": "po", } + + +CreateISO Settings +================== + +Options +------- + +**createiso_skip** = False + (*list*) -- mapping that defines which variants and arches to skip during createiso; format: [(variant_uid_regex, {arch|*: True})] + +.. note:: + + Source architecture needs to be listed explicitly. + Excluding '*' applies only on binary arches. + + +Example +------- +:: + + createiso_skip = [ + ('^Workstation$', { + '*': True, + 'src': True + }), + ] diff --git a/pungi/phases/createiso.py b/pungi/phases/createiso.py index 8d1392a7..6ba8a5ef 100644 --- a/pungi/phases/createiso.py +++ b/pungi/phases/createiso.py @@ -32,7 +32,7 @@ from pungi.wrappers.createrepo import CreaterepoWrapper from pungi.wrappers.kojiwrapper import KojiWrapper from pungi.wrappers.jigdo import JigdoWrapper from pungi.phases.base import PhaseBase -from pungi.util import makedirs, get_volid +from pungi.util import makedirs, get_volid, get_arch_variant_data from pungi.media_split import MediaSplitter from pungi.compose_metadata.discinfo import read_discinfo, write_discinfo @@ -40,6 +40,14 @@ from pungi.compose_metadata.discinfo import read_discinfo, write_discinfo class CreateisoPhase(PhaseBase): name = "createiso" + config_options = ( + { + "name": "createiso_skip", + "expected_types": [list], + "optional": True, + }, + ) + def __init__(self, compose): PhaseBase.__init__(self, compose) self.pool = ThreadPool(logger=self.compose._logger) @@ -51,6 +59,11 @@ class CreateisoPhase(PhaseBase): commands = [] for variant in self.compose.get_variants(types=["variant", "layered-product", "optional"], recursive=True): for arch in variant.arches + ["src"]: + skip_iso = get_arch_variant_data(self.compose.conf, "createiso_skip", arch, variant) + if skip_iso == [True]: + self.compose.log_info("Skipping createiso for %s.%s due to config option" % (variant, arch)) + continue + volid = get_volid(self.compose, arch, variant) os_tree = self.compose.paths.compose.os_tree(arch, variant) diff --git a/tests/data/dummy-pungi.conf b/tests/data/dummy-pungi.conf index 018ad01c..81a3aaa5 100644 --- a/tests/data/dummy-pungi.conf +++ b/tests/data/dummy-pungi.conf @@ -96,3 +96,12 @@ multilib_whitelist = { # BUILDINSTALL bootable = False + + +# CREATEISO +createiso_skip = [ + ('^Server-Gluster$', { + '*': True, + 'src': True + }), +]