config: Deprecate bootable option

JIRA: COMPOSE-2635
Fixes: https://pagure.io/pungi/issue/976
Signed-off-by: Haibo Lin <hlin@redhat.com>
This commit is contained in:
Haibo Lin 2019-07-22 15:29:47 +08:00
parent cf52665a8d
commit 3811c0a176
11 changed files with 14 additions and 44 deletions

View File

@ -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 <scm_support>`, *str*) -- reference to install class **file**

View File

@ -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"]),

View File

@ -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)

View File

@ -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")

View File

@ -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,

View File

@ -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

View File

@ -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

View File

@ -95,10 +95,6 @@ multilib_whitelist = {
}
# BUILDINSTALL
bootable = False
# CREATEISO
createiso_skip = [
('^Server-ResilientStorage$', {

View File

@ -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 = []

View File

@ -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:

View File

@ -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=[]
)