config: Deprecate runroot option
Fixes: https://pagure.io/pungi/issue/975 Signed-off-by: Haibo Lin <hlin@redhat.com>
This commit is contained in:
parent
920eceaa5a
commit
c4ed2bf3b2
@ -851,10 +851,6 @@ Options
|
||||
to set up your Koji client profile. In the examples, the profile name is
|
||||
"koji", which points to Fedora's koji.fedoraproject.org.
|
||||
|
||||
**runroot** [mandatory]
|
||||
(*bool*) -- run some tasks such as buildinstall or createiso in koji build root (True) or locally (False).
|
||||
There might also be other runroot methods available. These can be chosen by ``runroot_method`` option.
|
||||
|
||||
**runroot_method**
|
||||
(*str*) -- Runroot method to use. It can further specify the runroot method
|
||||
in case the ``runroot`` is set to True.
|
||||
@ -889,7 +885,6 @@ Example
|
||||
::
|
||||
|
||||
koji_profile = "koji"
|
||||
runroot = True
|
||||
runroot_channel = "runroot"
|
||||
runroot_tag = "f23-build"
|
||||
|
||||
|
@ -65,8 +65,8 @@ def is_isohybrid_needed(conf):
|
||||
to check for it. Additionally, the syslinux package is only available on
|
||||
x86_64 and i386.
|
||||
"""
|
||||
runroot = conf.get('runroot', False)
|
||||
if runroot and not _will_productimg_run(conf):
|
||||
runroot_tag = conf.get('runroot_tag', '')
|
||||
if runroot_tag and not _will_productimg_run(conf):
|
||||
return False
|
||||
if platform.machine() not in ('x86_64', 'i686', 'i386'):
|
||||
print('Not checking for /usr/bin/isohybrid due to current architecture. '
|
||||
@ -78,8 +78,8 @@ def is_isohybrid_needed(conf):
|
||||
def is_genisoimage_needed(conf):
|
||||
"""This is only needed locally for productimg and createiso without runroot.
|
||||
"""
|
||||
runroot = conf.get('runroot', False)
|
||||
if runroot and not _will_productimg_run(conf):
|
||||
runroot_tag = conf.get('runroot_tag', '')
|
||||
if runroot_tag and not _will_productimg_run(conf):
|
||||
return False
|
||||
return True
|
||||
|
||||
@ -564,8 +564,7 @@ def make_schema():
|
||||
},
|
||||
|
||||
"runroot": {
|
||||
"type": "boolean",
|
||||
"default": False,
|
||||
"deprecated": "remove it. Please specify 'runroot_tag' if you want to enable runroot, otherwise run things locally",
|
||||
},
|
||||
"runroot_method": {
|
||||
"type": "string",
|
||||
@ -1286,7 +1285,7 @@ def make_schema():
|
||||
|
||||
"required": ["release_name", "release_short", "release_version",
|
||||
"variants_file",
|
||||
"runroot", "pkgset_source",
|
||||
"pkgset_source",
|
||||
"gather_method"],
|
||||
"additionalProperties": False,
|
||||
}
|
||||
@ -1383,14 +1382,6 @@ CONFIG_DEPS = {
|
||||
(lambda x: not x, ["base_product_name", "base_product_short"]),
|
||||
),
|
||||
},
|
||||
"runroot": {
|
||||
"requires": (
|
||||
(lambda x: x, ["koji_profile", "runroot_tag", "runroot_channel"]),
|
||||
),
|
||||
"conflicts": (
|
||||
(lambda x: not x, ["runroot_tag", "runroot_channel", "runroot_weights"]),
|
||||
),
|
||||
},
|
||||
"product_id": {
|
||||
"conflicts": [
|
||||
(lambda x: not x, ['product_id_allow_missing']),
|
||||
|
@ -193,7 +193,6 @@ class CreateIsoThread(WorkerThread):
|
||||
if "mount" in cmd:
|
||||
mounts.append(cmd["mount"])
|
||||
|
||||
runroot = compose.conf["runroot"]
|
||||
bootable = cmd['bootable']
|
||||
log_file = compose.paths.log.log_file(
|
||||
arch, "createiso-%s" % os.path.basename(cmd["iso_path"]))
|
||||
@ -203,7 +202,7 @@ class CreateIsoThread(WorkerThread):
|
||||
self.pool.log_info("[BEGIN] %s" % msg)
|
||||
|
||||
try:
|
||||
run_createiso_command(runroot, num, compose, bootable, arch,
|
||||
run_createiso_command(num, compose, bootable, arch,
|
||||
cmd['cmd'], mounts, log_file)
|
||||
except Exception:
|
||||
self.fail(compose, cmd, variant, arch)
|
||||
@ -267,7 +266,7 @@ def add_iso_to_metadata(
|
||||
return img
|
||||
|
||||
|
||||
def run_createiso_command(runroot, num, compose, bootable, arch, cmd, mounts,
|
||||
def run_createiso_command(num, compose, bootable, arch, cmd, mounts,
|
||||
log_file, with_jigdo=True):
|
||||
packages = ["coreutils", "genisoimage", "isomd5sum"]
|
||||
if with_jigdo and compose.conf['create_jigdo']:
|
||||
|
@ -120,7 +120,7 @@ class ExtraIsosThread(WorkerThread):
|
||||
with open(script_file, 'w') as f:
|
||||
createiso.write_script(opts, f)
|
||||
|
||||
run_createiso_command(compose.conf["runroot"], self.num, compose, bootable, arch,
|
||||
run_createiso_command(self.num, compose, bootable, arch,
|
||||
['bash', script_file], [compose.topdir],
|
||||
log_file=compose.paths.log.log_file(
|
||||
arch, "extraiso-%s" % os.path.basename(iso_path)),
|
||||
|
@ -11,7 +11,7 @@ variants_file = "dummy-variants.xml"
|
||||
|
||||
|
||||
# KOJI SETTINGS
|
||||
runroot = False
|
||||
runroot_tag = ''
|
||||
|
||||
|
||||
# PKGSET
|
||||
|
@ -259,7 +259,6 @@ BASE_CONFIG = dict(
|
||||
release_name='Test',
|
||||
release_version='1.0',
|
||||
variants_file='variants.xml',
|
||||
runroot=False,
|
||||
createrepo_checksum='sha256',
|
||||
gather_method='deps',
|
||||
)
|
||||
|
@ -63,7 +63,7 @@ class CheckDependenciesTestCase(unittest.TestCase):
|
||||
conf = {
|
||||
'bootable': True,
|
||||
'productimg': False,
|
||||
'runroot': True,
|
||||
'runroot_tag': 'dummy_tag',
|
||||
}
|
||||
|
||||
with mock.patch('sys.stdout', new_callable=StringIO) as out:
|
||||
@ -77,7 +77,7 @@ class CheckDependenciesTestCase(unittest.TestCase):
|
||||
def test_isohybrid_not_required_on_not_bootable(self):
|
||||
conf = {
|
||||
'bootable': False,
|
||||
'runroot': True,
|
||||
'runroot_tag': 'dummy_tag',
|
||||
}
|
||||
|
||||
with mock.patch('sys.stdout', new_callable=StringIO) as out:
|
||||
@ -92,7 +92,7 @@ class CheckDependenciesTestCase(unittest.TestCase):
|
||||
conf = {
|
||||
'bootable': True,
|
||||
'productimg': True,
|
||||
'runroot': True,
|
||||
'runroot_tag': 'dummy_tag',
|
||||
}
|
||||
|
||||
with mock.patch('sys.stdout', new_callable=StringIO) as out:
|
||||
@ -107,7 +107,7 @@ class CheckDependenciesTestCase(unittest.TestCase):
|
||||
|
||||
def test_isohybrid_not_needed_in_runroot(self):
|
||||
conf = {
|
||||
'runroot': True,
|
||||
'runroot_tag': 'dummy_tag',
|
||||
}
|
||||
|
||||
with mock.patch('sys.stdout', new_callable=StringIO) as out:
|
||||
@ -120,7 +120,7 @@ class CheckDependenciesTestCase(unittest.TestCase):
|
||||
|
||||
def test_genisoimg_not_needed_in_runroot(self):
|
||||
conf = {
|
||||
'runroot': True,
|
||||
'runroot_tag': 'dummy_tag',
|
||||
}
|
||||
|
||||
with mock.patch('sys.stdout', new_callable=StringIO) as out:
|
||||
@ -133,7 +133,7 @@ class CheckDependenciesTestCase(unittest.TestCase):
|
||||
|
||||
def test_genisoimg_needed_for_productimg(self):
|
||||
conf = {
|
||||
'runroot': True,
|
||||
'runroot_tag': 'dummy_tag',
|
||||
'productimg': True,
|
||||
'bootable': True,
|
||||
}
|
||||
|
@ -145,7 +145,7 @@ class ImageNameConfigTestCase(ConfigTestCase):
|
||||
|
||||
|
||||
class RunrootConfigTestCase(ConfigTestCase):
|
||||
def test_runroot_without_deps(self):
|
||||
def test_set_runroot_true(self):
|
||||
cfg = load_config(
|
||||
PKGSET_REPOS,
|
||||
runroot=True,
|
||||
@ -153,23 +153,17 @@ class RunrootConfigTestCase(ConfigTestCase):
|
||||
|
||||
self.assertValidation(
|
||||
cfg,
|
||||
[checks.REQUIRES.format('runroot', 'True', 'koji_profile'),
|
||||
checks.REQUIRES.format('runroot', 'True', 'runroot_tag'),
|
||||
checks.REQUIRES.format('runroot', 'True', 'runroot_channel')])
|
||||
warnings=["WARNING: Config option runroot was removed and has no effect; remove it. Please specify 'runroot_tag' if you want to enable runroot, otherwise run things locally."])
|
||||
|
||||
def test_koji_settings_without_runroot(self):
|
||||
def test_set_runroot_false(self):
|
||||
cfg = load_config(
|
||||
PKGSET_REPOS,
|
||||
runroot=False,
|
||||
koji_profile='koji',
|
||||
runroot_tag='f25',
|
||||
runroot_channel='compose',
|
||||
)
|
||||
|
||||
self.assertValidation(
|
||||
cfg,
|
||||
[checks.CONFLICTS.format('runroot', 'False', 'runroot_tag'),
|
||||
checks.CONFLICTS.format('runroot', 'False', 'runroot_channel')])
|
||||
warnings=["WARNING: Config option runroot was removed and has no effect; remove it. Please specify 'runroot_tag' if you want to enable runroot, otherwise run things locally."])
|
||||
|
||||
|
||||
class BuildinstallConfigTestCase(ConfigTestCase):
|
||||
|
@ -149,7 +149,7 @@ class ExtraIsosThreadTest(helpers.PungiTestCase):
|
||||
)
|
||||
self.assertEqual(
|
||||
rcc.call_args_list,
|
||||
[mock.call(False, 1, compose, True, 'x86_64',
|
||||
[mock.call(1, compose, True, 'x86_64',
|
||||
['bash', os.path.join(self.topdir, 'work/x86_64/tmp-Server/extraiso-my.iso.sh')],
|
||||
[self.topdir],
|
||||
log_file=os.path.join(self.topdir, 'logs/x86_64/extraiso-my.iso.x86_64.log'),
|
||||
@ -205,7 +205,7 @@ class ExtraIsosThreadTest(helpers.PungiTestCase):
|
||||
)
|
||||
self.assertEqual(
|
||||
rcc.call_args_list,
|
||||
[mock.call(False, 1, compose, True, 'x86_64',
|
||||
[mock.call(1, compose, True, 'x86_64',
|
||||
['bash', os.path.join(self.topdir, 'work/x86_64/tmp-Server/extraiso-my.iso.sh')],
|
||||
[self.topdir],
|
||||
log_file=os.path.join(self.topdir, 'logs/x86_64/extraiso-my.iso.x86_64.log'),
|
||||
@ -261,7 +261,7 @@ class ExtraIsosThreadTest(helpers.PungiTestCase):
|
||||
)
|
||||
self.assertEqual(
|
||||
rcc.call_args_list,
|
||||
[mock.call(False, 1, compose, True, "x86_64",
|
||||
[mock.call(1, compose, True, "x86_64",
|
||||
["bash", os.path.join(self.topdir, "work/x86_64/tmp-Server/extraiso-my.iso.sh")],
|
||||
[self.topdir],
|
||||
log_file=os.path.join(self.topdir, "logs/x86_64/extraiso-my.iso.x86_64.log"),
|
||||
@ -316,7 +316,7 @@ class ExtraIsosThreadTest(helpers.PungiTestCase):
|
||||
)
|
||||
self.assertEqual(
|
||||
rcc.call_args_list,
|
||||
[mock.call(False, 1, compose, False, 'x86_64',
|
||||
[mock.call(1, compose, False, 'x86_64',
|
||||
['bash', os.path.join(self.topdir, 'work/x86_64/tmp-Server/extraiso-my.iso.sh')],
|
||||
[self.topdir],
|
||||
log_file=os.path.join(self.topdir, 'logs/x86_64/extraiso-my.iso.x86_64.log'),
|
||||
@ -371,7 +371,7 @@ class ExtraIsosThreadTest(helpers.PungiTestCase):
|
||||
)
|
||||
self.assertEqual(
|
||||
rcc.call_args_list,
|
||||
[mock.call(False, 1, compose, False, 'src',
|
||||
[mock.call(1, compose, False, 'src',
|
||||
['bash', os.path.join(self.topdir, 'work/src/tmp-Server/extraiso-my.iso.sh')],
|
||||
[self.topdir],
|
||||
log_file=os.path.join(self.topdir, 'logs/src/extraiso-my.iso.src.log'),
|
||||
|
Loading…
Reference in New Issue
Block a user