From 3811c0a176f102effe49e78bcec7835363b7a16a Mon Sep 17 00:00:00 2001 From: Haibo Lin Date: Mon, 22 Jul 2019 15:29:47 +0800 Subject: [PATCH] config: Deprecate bootable option JIRA: COMPOSE-2635 Fixes: https://pagure.io/pungi/issue/976 Signed-off-by: Haibo Lin --- doc/configuration.rst | 6 +----- pungi/checks.py | 13 ++----------- pungi/phases/buildinstall.py | 2 +- pungi/phases/createiso.py | 2 +- pungi/phases/extra_isos.py | 2 +- pungi/phases/pkgset/sources/source_koji.py | 2 +- pungi/phases/product_img.py | 2 +- tests/data/dummy-pungi.conf | 4 ---- tests/test_buildinstall.py | 2 +- tests/test_checks.py | 4 ++-- tests/test_config.py | 19 +++---------------- 11 files changed, 14 insertions(+), 44 deletions(-) diff --git a/doc/configuration.rst b/doc/configuration.rst index 3555afaf..aad91e42 100644 --- a/doc/configuration.rst +++ b/doc/configuration.rst @@ -41,7 +41,6 @@ Minimal Config Example check_deps = False # BUILDINSTALL - bootable = True buildinstall_method = "lorax" @@ -521,8 +520,6 @@ Anaconda installer is historically called Options ------- -**bootable** - (*bool*) -- whether to run the buildinstall phase **buildinstall_method** (*str*) -- "lorax" (f16+, rhel7+) or "buildinstall" (older releases) **lorax_options** @@ -565,7 +562,6 @@ Example ------- :: - bootable = True buildinstall_method = "lorax" # Enables macboot on x86_64 for all variants and builds upgrade images @@ -1045,7 +1041,7 @@ Options ------- **productimg** = False - (*bool*) -- create product images; requires bootable=True + (*bool*) -- create product images; requires buildinstall_method option **productimg_install_class** (:ref:`scm_dict `, *str*) -- reference to install class **file** diff --git a/pungi/checks.py b/pungi/checks.py index 7073f834..17ff8b50 100644 --- a/pungi/checks.py +++ b/pungi/checks.py @@ -52,7 +52,7 @@ from . import util def _will_productimg_run(conf): - return conf.get('productimg', False) and conf.get('bootable', False) + return conf.get('productimg', False) and conf.get('buildinstall_method', '') def is_jigdo_needed(conf): @@ -600,8 +600,7 @@ def make_schema(): "default": False, }, "bootable": { - "type": "boolean", - "default": False + "deprecated": "remove it. Setting buildinstall_method option if you want a bootable installer" }, "gather_method": { @@ -1347,14 +1346,6 @@ CONFIG_DEPS = { ), }, - "bootable": { - "requires": ( - (lambda x: x, ["buildinstall_method"]), - ), - "conflicts": ( - (lambda x: not x, ["buildinstall_method"]), - ), - }, "buildinstall_method": { "conflicts": ( (lambda val: val == "buildinstall", ["lorax_options"]), diff --git a/pungi/phases/buildinstall.py b/pungi/phases/buildinstall.py index e8feea09..130f0fbd 100644 --- a/pungi/phases/buildinstall.py +++ b/pungi/phases/buildinstall.py @@ -53,7 +53,7 @@ class BuildinstallPhase(PhaseBase): def skip(self): if PhaseBase.skip(self): return True - if not self.compose.conf.get("bootable"): + if not self.compose.conf.get("buildinstall_method"): if not self.warned_skipped: msg = "Not a bootable product. Skipping buildinstall." self.compose.log_debug(msg) diff --git a/pungi/phases/createiso.py b/pungi/phases/createiso.py index 2108a45c..1c9a38aa 100644 --- a/pungi/phases/createiso.py +++ b/pungi/phases/createiso.py @@ -63,7 +63,7 @@ class CreateisoPhase(PhaseLoggerMixin, PhaseBase): if skip == [True]: # Buildinstall is skipped for this tree. Can't create a bootable ISO. return False - return self.compose.conf["bootable"] + return bool(self.compose.conf.get('buildinstall_method', '')) def run(self): symlink_isos_to = self.compose.conf.get("symlink_isos_to") diff --git a/pungi/phases/extra_isos.py b/pungi/phases/extra_isos.py index 99229398..d84cef92 100644 --- a/pungi/phases/extra_isos.py +++ b/pungi/phases/extra_isos.py @@ -86,7 +86,7 @@ class ExtraIsosThread(WorkerThread): get_extra_files(compose, variant, arch, config.get('extra_files', [])) - bootable = arch != "src" and compose.conf['bootable'] + bootable = arch != "src" and bool(compose.conf.get('buildinstall_method')) graft_points = get_iso_contents( compose, diff --git a/pungi/phases/pkgset/sources/source_koji.py b/pungi/phases/pkgset/sources/source_koji.py index 1a7bf3ac..6564963e 100644 --- a/pungi/phases/pkgset/sources/source_koji.py +++ b/pungi/phases/pkgset/sources/source_koji.py @@ -529,7 +529,7 @@ def populate_global_pkgset(compose, koji_wrapper, path_prefix, event): comps = CompsWrapper(compose.paths.work.comps()) for group in groups: packages_to_gather += comps.get_packages(group) - if compose.conf["gather_method"] == "nodeps" and not compose.conf.get('bootable'): + if compose.conf["gather_method"] == "nodeps" and not compose.conf.get('buildinstall_method'): populate_only_packages_to_gather = True else: populate_only_packages_to_gather = False diff --git a/pungi/phases/product_img.py b/pungi/phases/product_img.py index c9566748..2449917a 100644 --- a/pungi/phases/product_img.py +++ b/pungi/phases/product_img.py @@ -66,7 +66,7 @@ class ProductimgPhase(PhaseBase): msg = "Config option 'productimg' not set. Skipping creating product images." self.compose.log_debug(msg) return True - if not self.compose.conf["bootable"]: + if not self.compose.conf["buildinstall_method"]: msg = "Not a bootable product. Skipping creating product images." self.compose.log_debug(msg) return True diff --git a/tests/data/dummy-pungi.conf b/tests/data/dummy-pungi.conf index b941be8c..5225f34d 100644 --- a/tests/data/dummy-pungi.conf +++ b/tests/data/dummy-pungi.conf @@ -95,10 +95,6 @@ multilib_whitelist = { } -# BUILDINSTALL -bootable = False - - # CREATEISO createiso_skip = [ ('^Server-ResilientStorage$', { diff --git a/tests/test_buildinstall.py b/tests/test_buildinstall.py index 09f00743..71183475 100644 --- a/tests/test_buildinstall.py +++ b/tests/test_buildinstall.py @@ -74,7 +74,7 @@ class TestBuildinstallPhase(PungiTestCase): self.assertEqual(1, len(pool.queue_put.mock_calls)) def test_does_not_skip_on_bootable(self): - compose = BuildInstallCompose(self.topdir, {'bootable': True}) + compose = BuildInstallCompose(self.topdir, {'buildinstall_method': 'lorax'}) compose.just_phases = None compose.skip_phases = [] diff --git a/tests/test_checks.py b/tests/test_checks.py index 3fc33881..147d0286 100644 --- a/tests/test_checks.py +++ b/tests/test_checks.py @@ -90,7 +90,7 @@ class CheckDependenciesTestCase(unittest.TestCase): def test_isohybrid_not_required_on_arm(self): conf = { - 'bootable': True, + 'buildinstall_method': 'lorax', 'productimg': True, 'runroot_tag': 'dummy_tag', } @@ -135,7 +135,7 @@ class CheckDependenciesTestCase(unittest.TestCase): conf = { 'runroot_tag': 'dummy_tag', 'productimg': True, - 'bootable': True, + 'buildinstall_method': 'lorax', } with mock.patch('sys.stdout', new_callable=StringIO) as out: diff --git a/tests/test_config.py b/tests/test_config.py index c9bf0a82..549873eb 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -167,7 +167,7 @@ class RunrootConfigTestCase(ConfigTestCase): class BuildinstallConfigTestCase(ConfigTestCase): - def test_bootable_without_method(self): + def test_bootable_deprecated(self): cfg = load_config( PKGSET_REPOS, bootable=True, @@ -175,18 +175,7 @@ class BuildinstallConfigTestCase(ConfigTestCase): self.assertValidation( cfg, - [checks.REQUIRES.format('bootable', 'True', 'buildinstall_method')]) - - def test_non_bootable_with_method(self): - cfg = load_config( - PKGSET_REPOS, - bootable=False, - buildinstall_method='lorax', - ) - - self.assertValidation( - cfg, - [checks.CONFLICTS.format('bootable', 'False', 'buildinstall_method')]) + warnings=['WARNING: Config option bootable was removed and has no effect; remove it. Setting buildinstall_method option if you want a bootable installer.']) def test_buildinstall_method_without_bootable(self): cfg = load_config( @@ -196,12 +185,11 @@ class BuildinstallConfigTestCase(ConfigTestCase): self.assertValidation( cfg, - [checks.CONFLICTS.format('bootable', 'False', 'buildinstall_method')]) + []) def test_buildinstall_with_lorax_options(self): cfg = load_config( PKGSET_REPOS, - bootable=True, buildinstall_method='buildinstall', lorax_options=[('^Server$', {})] ) @@ -213,7 +201,6 @@ class BuildinstallConfigTestCase(ConfigTestCase): def test_lorax_with_lorax_options(self): cfg = load_config( PKGSET_REPOS, - bootable=True, buildinstall_method='lorax', lorax_options=[] )