diff --git a/pungi/checks.py b/pungi/checks.py index 9c4c8a95..26749660 100644 --- a/pungi/checks.py +++ b/pungi/checks.py @@ -564,7 +564,7 @@ def make_schema(): }, "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": { "type": "string", diff --git a/pungi/phases/buildinstall.py b/pungi/phases/buildinstall.py index 181acfdc..e8feea09 100644 --- a/pungi/phases/buildinstall.py +++ b/pungi/phases/buildinstall.py @@ -399,7 +399,6 @@ class BuildinstallThread(WorkerThread): self.worker(compose, arch, variant, cmd, num) def worker(self, compose, arch, variant, cmd, num): - runroot = compose.conf["runroot"] buildinstall_method = compose.conf["buildinstall_method"] log_filename = ('buildinstall-%s' % variant.uid) if variant else 'buildinstall' log_file = compose.paths.log.log_file(arch, log_filename) diff --git a/pungi/runroot.py b/pungi/runroot.py index 43687b75..6c29873e 100644 --- a/pungi/runroot.py +++ b/pungi/runroot.py @@ -37,20 +37,20 @@ class Runroot(kobo.log.LoggingBase): 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. - :return: The "local" or "koji" string. + :return: The configured method """ - runroot = self.compose.conf.get("runroot", None) - runroot_method = self.compose.conf.get("runroot_method", None) - if runroot is None and runroot_method is None: - raise ValueError("No runroot_method set.") - if runroot is False: - runroot_method = "local" - elif runroot and not runroot_method: - runroot_method = "koji" - return runroot_method + runroot_tag = self.compose.conf.get("runroot_tag") + runroot_method = self.compose.conf.get("runroot_method") + if runroot_tag and not runroot_method: + # If we have runroot tag and no method, let's assume koji method + # for backwards compatibility. + return "koji" + # Otherwise use the configured method or default to local if nothing is + # given. + return runroot_method or "local" def _run_local(self, command, log_file=None, **kwargs): """ diff --git a/tests/test_buildinstall.py b/tests/test_buildinstall.py index 7d0103da..09f00743 100644 --- a/tests/test_buildinstall.py +++ b/tests/test_buildinstall.py @@ -568,7 +568,6 @@ class BuildinstallThreadTestCase(PungiTestCase): ): compose = BuildInstallCompose(self.topdir, { 'buildinstall_method': 'lorax', - 'runroot': True, 'runroot_tag': 'rrt', 'koji_profile': 'koji', 'runroot_weights': {'buildinstall': 123}, @@ -641,7 +640,6 @@ class BuildinstallThreadTestCase(PungiTestCase): ): compose = BuildInstallCompose(self.topdir, { 'buildinstall_method': 'buildinstall', - 'runroot': True, 'runroot_tag': 'rrt', 'koji_profile': 'koji', }) @@ -709,7 +707,6 @@ class BuildinstallThreadTestCase(PungiTestCase): def test_buildinstall_fail_exit_code(self, run, get_buildroot_rpms, KojiWrapperMock): compose = BuildInstallCompose(self.topdir, { 'buildinstall_method': 'buildinstall', - 'runroot': True, 'runroot_tag': 'rrt', 'koji_profile': 'koji', 'failable_deliverables': [ @@ -744,7 +741,6 @@ class BuildinstallThreadTestCase(PungiTestCase): def test_lorax_fail_exit_code(self, run, get_buildroot_rpms, KojiWrapperMock): compose = BuildInstallCompose(self.topdir, { 'buildinstall_method': 'lorax', - 'runroot': True, 'runroot_tag': 'rrt', 'koji_profile': 'koji', 'failable_deliverables': [ @@ -778,7 +774,6 @@ class BuildinstallThreadTestCase(PungiTestCase): def test_skips_on_existing_output_dir(self, run, get_buildroot_rpms, KojiWrapperMock): compose = BuildInstallCompose(self.topdir, { 'buildinstall_method': 'lorax', - 'runroot': True, 'runroot_tag': 'rrt', 'koji_profile': 'koji', 'failable_deliverables': [ @@ -812,7 +807,6 @@ class BuildinstallThreadTestCase(PungiTestCase): ): compose = BuildInstallCompose(self.topdir, { 'buildinstall_method': 'lorax', - 'runroot': True, 'runroot_tag': 'rrt', 'koji_profile': 'koji', 'runroot_weights': {'buildinstall': 123}, diff --git a/tests/test_config.py b/tests/test_config.py index 4fbe6420..c9bf0a82 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -153,7 +153,7 @@ class RunrootConfigTestCase(ConfigTestCase): self.assertValidation( 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): cfg = load_config( @@ -163,7 +163,7 @@ class RunrootConfigTestCase(ConfigTestCase): self.assertValidation( 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): diff --git a/tests/test_createiso_phase.py b/tests/test_createiso_phase.py index 8d4c4caf..d87a82c0 100644 --- a/tests/test_createiso_phase.py +++ b/tests/test_createiso_phase.py @@ -348,7 +348,6 @@ class CreateisoThreadTest(helpers.PungiTestCase): compose = helpers.DummyCompose(self.topdir, { 'release_short': 'test', 'release_version': '1.0', - 'runroot': True, 'runroot_tag': 'f25-build', 'koji_profile': 'koji', }) @@ -411,7 +410,6 @@ class CreateisoThreadTest(helpers.PungiTestCase): compose = helpers.DummyCompose(self.topdir, { 'release_short': 'test', 'release_version': '1.0', - 'runroot': True, 'runroot_tag': 'f25-build', 'koji_profile': 'koji', 'create_jigdo': False, @@ -475,7 +473,6 @@ class CreateisoThreadTest(helpers.PungiTestCase): compose = helpers.DummyCompose(self.topdir, { 'release_short': 'test', 'release_version': '1.0', - 'runroot': True, 'bootable': True, 'buildinstall_method': 'lorax', 'runroot_tag': 'f25-build', @@ -542,7 +539,6 @@ class CreateisoThreadTest(helpers.PungiTestCase): compose = helpers.DummyCompose(self.topdir, { 'release_short': 'test', 'release_version': '1.0', - 'runroot': True, 'runroot_tag': 'f25-build', 'koji_profile': 'koji', }) @@ -572,7 +568,6 @@ class CreateisoThreadTest(helpers.PungiTestCase): compose = helpers.DummyCompose(self.topdir, { 'release_short': 'test', 'release_version': '1.0', - 'runroot': True, 'runroot_tag': 'f25-build', 'koji_profile': 'koji', 'failable_deliverables': [ @@ -610,7 +605,6 @@ class CreateisoThreadTest(helpers.PungiTestCase): compose = helpers.DummyCompose(self.topdir, { 'release_short': 'test', 'release_version': '1.0', - 'runroot': True, 'runroot_tag': 'f25-build', 'koji_profile': 'koji', 'failable_deliverables': [ @@ -654,7 +648,6 @@ class CreateisoThreadTest(helpers.PungiTestCase): compose = helpers.DummyCompose(self.topdir, { 'release_short': 'test', 'release_version': '1.0', - 'runroot': False, }) cmd = { '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, { 'release_short': 'test', 'release_version': '1.0', - 'runroot': False, 'failable_deliverables': [ ('^.*$', {'*': 'iso'}) ] diff --git a/tests/test_ostree_installer_phase.py b/tests/test_ostree_installer_phase.py index 93857518..534f055d 100644 --- a/tests/test_ostree_installer_phase.py +++ b/tests/test_ostree_installer_phase.py @@ -102,7 +102,6 @@ class OstreeThreadTest(helpers.PungiTestCase): 'translate_paths': [ (self.topdir + '/work', 'http://example.com/work') ], - 'runroot': True, }) def assertImageAdded(self, compose, ImageCls, iso): diff --git a/tests/test_ostree_phase.py b/tests/test_ostree_phase.py index 51cf2799..105938be 100644 --- a/tests/test_ostree_phase.py +++ b/tests/test_ostree_phase.py @@ -121,7 +121,6 @@ class OSTreeThreadTest(helpers.PungiTestCase): 'translate_paths': [ (self.topdir, 'http://example.com') ], - 'runroot': True }) self.pool = mock.Mock()