Remove remaining mentions of runroot option

This also cleans up the runroot method detection code to not rely on the
now removed option.

JIRA: COMPOSE-2634
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2019-07-02 09:39:00 +02:00
parent 49d0ab797c
commit bf1b3e8421
8 changed files with 14 additions and 31 deletions

View File

@ -564,7 +564,7 @@ def make_schema():
}, },
"runroot": { "runroot": {
"deprecated": "remove it. Please specify 'runroot_tag' if you want to enable runroot, otherwise run things locally", "deprecated": "remove it. Please specify 'runroot_method' if you want to enable runroot, otherwise run things locally",
}, },
"runroot_method": { "runroot_method": {
"type": "string", "type": "string",

View File

@ -399,7 +399,6 @@ class BuildinstallThread(WorkerThread):
self.worker(compose, arch, variant, cmd, num) self.worker(compose, arch, variant, cmd, num)
def worker(self, compose, arch, variant, cmd, num): def worker(self, compose, arch, variant, cmd, num):
runroot = compose.conf["runroot"]
buildinstall_method = compose.conf["buildinstall_method"] buildinstall_method = compose.conf["buildinstall_method"]
log_filename = ('buildinstall-%s' % variant.uid) if variant else 'buildinstall' log_filename = ('buildinstall-%s' % variant.uid) if variant else 'buildinstall'
log_file = compose.paths.log.log_file(arch, log_filename) log_file = compose.paths.log.log_file(arch, log_filename)

View File

@ -37,20 +37,20 @@ class Runroot(kobo.log.LoggingBase):
def get_runroot_method(self): def get_runroot_method(self):
""" """
Returns the runroot method by checking the `runroot` and Returns the runroot method by checking the `runroot_tag` and
`runroot_method` options in configuration. `runroot_method` options in configuration.
:return: The "local" or "koji" string. :return: The configured method
""" """
runroot = self.compose.conf.get("runroot", None) runroot_tag = self.compose.conf.get("runroot_tag")
runroot_method = self.compose.conf.get("runroot_method", None) runroot_method = self.compose.conf.get("runroot_method")
if runroot is None and runroot_method is None: if runroot_tag and not runroot_method:
raise ValueError("No runroot_method set.") # If we have runroot tag and no method, let's assume koji method
if runroot is False: # for backwards compatibility.
runroot_method = "local" return "koji"
elif runroot and not runroot_method: # Otherwise use the configured method or default to local if nothing is
runroot_method = "koji" # given.
return runroot_method return runroot_method or "local"
def _run_local(self, command, log_file=None, **kwargs): def _run_local(self, command, log_file=None, **kwargs):
""" """

View File

@ -568,7 +568,6 @@ class BuildinstallThreadTestCase(PungiTestCase):
): ):
compose = BuildInstallCompose(self.topdir, { compose = BuildInstallCompose(self.topdir, {
'buildinstall_method': 'lorax', 'buildinstall_method': 'lorax',
'runroot': True,
'runroot_tag': 'rrt', 'runroot_tag': 'rrt',
'koji_profile': 'koji', 'koji_profile': 'koji',
'runroot_weights': {'buildinstall': 123}, 'runroot_weights': {'buildinstall': 123},
@ -641,7 +640,6 @@ class BuildinstallThreadTestCase(PungiTestCase):
): ):
compose = BuildInstallCompose(self.topdir, { compose = BuildInstallCompose(self.topdir, {
'buildinstall_method': 'buildinstall', 'buildinstall_method': 'buildinstall',
'runroot': True,
'runroot_tag': 'rrt', 'runroot_tag': 'rrt',
'koji_profile': 'koji', 'koji_profile': 'koji',
}) })
@ -709,7 +707,6 @@ class BuildinstallThreadTestCase(PungiTestCase):
def test_buildinstall_fail_exit_code(self, run, get_buildroot_rpms, KojiWrapperMock): def test_buildinstall_fail_exit_code(self, run, get_buildroot_rpms, KojiWrapperMock):
compose = BuildInstallCompose(self.topdir, { compose = BuildInstallCompose(self.topdir, {
'buildinstall_method': 'buildinstall', 'buildinstall_method': 'buildinstall',
'runroot': True,
'runroot_tag': 'rrt', 'runroot_tag': 'rrt',
'koji_profile': 'koji', 'koji_profile': 'koji',
'failable_deliverables': [ 'failable_deliverables': [
@ -744,7 +741,6 @@ class BuildinstallThreadTestCase(PungiTestCase):
def test_lorax_fail_exit_code(self, run, get_buildroot_rpms, KojiWrapperMock): def test_lorax_fail_exit_code(self, run, get_buildroot_rpms, KojiWrapperMock):
compose = BuildInstallCompose(self.topdir, { compose = BuildInstallCompose(self.topdir, {
'buildinstall_method': 'lorax', 'buildinstall_method': 'lorax',
'runroot': True,
'runroot_tag': 'rrt', 'runroot_tag': 'rrt',
'koji_profile': 'koji', 'koji_profile': 'koji',
'failable_deliverables': [ 'failable_deliverables': [
@ -778,7 +774,6 @@ class BuildinstallThreadTestCase(PungiTestCase):
def test_skips_on_existing_output_dir(self, run, get_buildroot_rpms, KojiWrapperMock): def test_skips_on_existing_output_dir(self, run, get_buildroot_rpms, KojiWrapperMock):
compose = BuildInstallCompose(self.topdir, { compose = BuildInstallCompose(self.topdir, {
'buildinstall_method': 'lorax', 'buildinstall_method': 'lorax',
'runroot': True,
'runroot_tag': 'rrt', 'runroot_tag': 'rrt',
'koji_profile': 'koji', 'koji_profile': 'koji',
'failable_deliverables': [ 'failable_deliverables': [
@ -812,7 +807,6 @@ class BuildinstallThreadTestCase(PungiTestCase):
): ):
compose = BuildInstallCompose(self.topdir, { compose = BuildInstallCompose(self.topdir, {
'buildinstall_method': 'lorax', 'buildinstall_method': 'lorax',
'runroot': True,
'runroot_tag': 'rrt', 'runroot_tag': 'rrt',
'koji_profile': 'koji', 'koji_profile': 'koji',
'runroot_weights': {'buildinstall': 123}, 'runroot_weights': {'buildinstall': 123},

View File

@ -153,7 +153,7 @@ class RunrootConfigTestCase(ConfigTestCase):
self.assertValidation( self.assertValidation(
cfg, cfg,
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."]) warnings=["WARNING: Config option runroot was removed and has no effect; remove it. Please specify 'runroot_method' if you want to enable runroot, otherwise run things locally."])
def test_set_runroot_false(self): def test_set_runroot_false(self):
cfg = load_config( cfg = load_config(
@ -163,7 +163,7 @@ class RunrootConfigTestCase(ConfigTestCase):
self.assertValidation( self.assertValidation(
cfg, cfg,
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."]) warnings=["WARNING: Config option runroot was removed and has no effect; remove it. Please specify 'runroot_method' if you want to enable runroot, otherwise run things locally."])
class BuildinstallConfigTestCase(ConfigTestCase): class BuildinstallConfigTestCase(ConfigTestCase):

View File

@ -348,7 +348,6 @@ class CreateisoThreadTest(helpers.PungiTestCase):
compose = helpers.DummyCompose(self.topdir, { compose = helpers.DummyCompose(self.topdir, {
'release_short': 'test', 'release_short': 'test',
'release_version': '1.0', 'release_version': '1.0',
'runroot': True,
'runroot_tag': 'f25-build', 'runroot_tag': 'f25-build',
'koji_profile': 'koji', 'koji_profile': 'koji',
}) })
@ -411,7 +410,6 @@ class CreateisoThreadTest(helpers.PungiTestCase):
compose = helpers.DummyCompose(self.topdir, { compose = helpers.DummyCompose(self.topdir, {
'release_short': 'test', 'release_short': 'test',
'release_version': '1.0', 'release_version': '1.0',
'runroot': True,
'runroot_tag': 'f25-build', 'runroot_tag': 'f25-build',
'koji_profile': 'koji', 'koji_profile': 'koji',
'create_jigdo': False, 'create_jigdo': False,
@ -475,7 +473,6 @@ class CreateisoThreadTest(helpers.PungiTestCase):
compose = helpers.DummyCompose(self.topdir, { compose = helpers.DummyCompose(self.topdir, {
'release_short': 'test', 'release_short': 'test',
'release_version': '1.0', 'release_version': '1.0',
'runroot': True,
'bootable': True, 'bootable': True,
'buildinstall_method': 'lorax', 'buildinstall_method': 'lorax',
'runroot_tag': 'f25-build', 'runroot_tag': 'f25-build',
@ -542,7 +539,6 @@ class CreateisoThreadTest(helpers.PungiTestCase):
compose = helpers.DummyCompose(self.topdir, { compose = helpers.DummyCompose(self.topdir, {
'release_short': 'test', 'release_short': 'test',
'release_version': '1.0', 'release_version': '1.0',
'runroot': True,
'runroot_tag': 'f25-build', 'runroot_tag': 'f25-build',
'koji_profile': 'koji', 'koji_profile': 'koji',
}) })
@ -572,7 +568,6 @@ class CreateisoThreadTest(helpers.PungiTestCase):
compose = helpers.DummyCompose(self.topdir, { compose = helpers.DummyCompose(self.topdir, {
'release_short': 'test', 'release_short': 'test',
'release_version': '1.0', 'release_version': '1.0',
'runroot': True,
'runroot_tag': 'f25-build', 'runroot_tag': 'f25-build',
'koji_profile': 'koji', 'koji_profile': 'koji',
'failable_deliverables': [ 'failable_deliverables': [
@ -610,7 +605,6 @@ class CreateisoThreadTest(helpers.PungiTestCase):
compose = helpers.DummyCompose(self.topdir, { compose = helpers.DummyCompose(self.topdir, {
'release_short': 'test', 'release_short': 'test',
'release_version': '1.0', 'release_version': '1.0',
'runroot': True,
'runroot_tag': 'f25-build', 'runroot_tag': 'f25-build',
'koji_profile': 'koji', 'koji_profile': 'koji',
'failable_deliverables': [ 'failable_deliverables': [
@ -654,7 +648,6 @@ class CreateisoThreadTest(helpers.PungiTestCase):
compose = helpers.DummyCompose(self.topdir, { compose = helpers.DummyCompose(self.topdir, {
'release_short': 'test', 'release_short': 'test',
'release_version': '1.0', 'release_version': '1.0',
'runroot': False,
}) })
cmd = { cmd = {
'iso_path': '%s/compose/Server/x86_64/iso/image-name' % self.topdir, 'iso_path': '%s/compose/Server/x86_64/iso/image-name' % self.topdir,
@ -698,7 +691,6 @@ class CreateisoThreadTest(helpers.PungiTestCase):
compose = helpers.DummyCompose(self.topdir, { compose = helpers.DummyCompose(self.topdir, {
'release_short': 'test', 'release_short': 'test',
'release_version': '1.0', 'release_version': '1.0',
'runroot': False,
'failable_deliverables': [ 'failable_deliverables': [
('^.*$', {'*': 'iso'}) ('^.*$', {'*': 'iso'})
] ]

View File

@ -102,7 +102,6 @@ class OstreeThreadTest(helpers.PungiTestCase):
'translate_paths': [ 'translate_paths': [
(self.topdir + '/work', 'http://example.com/work') (self.topdir + '/work', 'http://example.com/work')
], ],
'runroot': True,
}) })
def assertImageAdded(self, compose, ImageCls, iso): def assertImageAdded(self, compose, ImageCls, iso):

View File

@ -121,7 +121,6 @@ class OSTreeThreadTest(helpers.PungiTestCase):
'translate_paths': [ 'translate_paths': [
(self.topdir, 'http://example.com') (self.topdir, 'http://example.com')
], ],
'runroot': True
}) })
self.pool = mock.Mock() self.pool = mock.Mock()