ostree-installer: Allow overwriting buildinstall

Relates: https://pagure.io/pungi/issue/909
Relates: https://pagure.io/pungi/issue/695
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2018-05-07 10:59:34 +02:00
parent 543154d597
commit 7c237c2c63
4 changed files with 26 additions and 1 deletions

View File

@ -1341,6 +1341,15 @@ an OSTree repository. This always runs in Koji as a ``runroot`` task.
``template_repo`` needs to point to a Git repository from which to take the
templates.
**ostree_installer_overwrite** = False
(*bool*) -- by default if a variant including OSTree installer also creates
regular installer images in buildinstall phase, there will be conflicts (as
the files are put in the same place) and Pungi will report an error and
fail the compose.
With this option it is possible to opt-in for the overwriting. The
traditional ``boot.iso`` will be in the ``iso/`` subdirectory.
Example config
--------------

View File

@ -968,6 +968,11 @@ def make_schema():
"additionalProperties": False,
}),
"ostree_installer_overwrite": {
"type": "boolean",
"default": False,
},
"live_images": _variant_arch_mapping(
_one_or_list({"$ref": "#/definitions/live_image_config"})
),

View File

@ -28,7 +28,7 @@ class OstreeInstallerPhase(PhaseLoggerMixin, ConfigGuardedPhase):
except ValueError as exc:
errors = exc.message.split('\n')
if not self.bi._skipped:
if not self.compose.conf['ostree_installer_overwrite'] and not self.bi._skipped:
for variant in self.compose.get_variants():
for arch in variant.arches:
conf = util.get_arch_variant_data(self.compose.conf, self.name,

View File

@ -74,6 +74,17 @@ class OstreeInstallerPhaseTest(helpers.PungiTestCase):
phase = ostree.OstreeInstallerPhase(compose, mock.Mock(_skipped=True))
phase.validate()
def test_validate_overwrite_enabled(self):
compose = helpers.DummyCompose(self.topdir, {
'ostree_installer_overwrite': True,
'ostree_installer': [
('^Server$', {'x86_64': mock.Mock()})
],
})
phase = ostree.OstreeInstallerPhase(compose, mock.Mock(_skipped=False))
phase.validate()
class OstreeThreadTest(helpers.PungiTestCase):