[buildinstall] Use customized dvd disc type

This should generate the same volume id in buildinstall and createiso
phases, with isolinux.cfg being consistent as well.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2016-03-14 08:20:43 +01:00
parent c321bca8ef
commit aa38eb1fd7
2 changed files with 14 additions and 10 deletions

View File

@ -125,6 +125,7 @@ class BuildinstallPhase(PhaseBase):
version = self.compose.conf["release_version"]
release = self.compose.conf["release_version"]
buildinstall_method = self.compose.conf["buildinstall_method"]
disc_type = self.compose.conf.get('disc_types', {}).get('dvd', 'dvd')
for arch in self.compose.get_arches():
commands = []
@ -137,13 +138,13 @@ class BuildinstallPhase(PhaseBase):
for variant in self.compose.get_variants(arch=arch, types=['variant']):
if variant.is_empty:
continue
volid = get_volid(self.compose, arch, variant=variant, disc_type="dvd")
volid = get_volid(self.compose, arch, variant=variant, disc_type=disc_type)
commands.append(
(variant,
self._get_lorax_cmd(repo_baseurl, output_dir, variant, arch, buildarch, volid))
)
elif buildinstall_method == "buildinstall":
volid = get_volid(self.compose, arch, disc_type="dvd")
volid = get_volid(self.compose, arch, disc_type=disc_type)
commands.append(
(None,
lorax.get_buildinstall_cmd(product,
@ -166,6 +167,7 @@ class BuildinstallPhase(PhaseBase):
def copy_files(self):
buildinstall_method = self.compose.conf["buildinstall_method"]
disc_type = self.compose.conf.get('disc_types', {}).get('dvd', 'dvd')
# copy buildinstall files to the 'os' dir
kickstart_file = get_kickstart_file(self.compose)
@ -187,7 +189,7 @@ class BuildinstallPhase(PhaseBase):
os_tree = self.compose.paths.compose.os_tree(arch, variant)
# TODO: label is not used
label = ""
volid = get_volid(self.compose, arch, variant, escape_spaces=False, disc_type="dvd")
volid = get_volid(self.compose, arch, variant, escape_spaces=False, disc_type=disc_type)
tweak_buildinstall(buildinstall_dir, os_tree, arch, variant.uid, label, volid, kickstart_file)
link_boot_iso(self.compose, arch, variant)

View File

@ -57,7 +57,8 @@ class TestBuildinstallPhase(PungiTestCase):
'release_short': 't',
'release_version': '1',
'release_is_layered': False,
'buildinstall_method': 'lorax'
'buildinstall_method': 'lorax',
'disc_types': {'dvd': 'DVD'},
})
get_volid.return_value = 'vol_id'
@ -91,9 +92,9 @@ class TestBuildinstallPhase(PungiTestCase):
bugurl=None)])
self.assertItemsEqual(
get_volid.mock_calls,
[mock.call(compose, 'x86_64', variant=compose.variants['Server'], disc_type='dvd'),
mock.call(compose, 'amd64', variant=compose.variants['Client'], disc_type='dvd'),
mock.call(compose, 'amd64', variant=compose.variants['Server'], disc_type='dvd')])
[mock.call(compose, 'x86_64', variant=compose.variants['Server'], disc_type='DVD'),
mock.call(compose, 'amd64', variant=compose.variants['Client'], disc_type='DVD'),
mock.call(compose, 'amd64', variant=compose.variants['Server'], disc_type='DVD')])
@mock.patch('pungi.phases.buildinstall.ThreadPool')
@mock.patch('pungi.phases.buildinstall.LoraxWrapper')
@ -141,7 +142,8 @@ class TestBuildinstallPhase(PungiTestCase):
'release_short': 't',
'release_version': '1',
'release_is_layered': False,
'buildinstall_method': 'buildinstall'
'buildinstall_method': 'buildinstall',
'disc_types': {'dvd': 'DVD'},
})
get_volid.return_value = 'vol_id'
@ -165,8 +167,8 @@ class TestBuildinstallPhase(PungiTestCase):
buildarch='amd64', is_final=True, volid='vol_id')])
self.assertItemsEqual(
get_volid.mock_calls,
[mock.call(compose, 'x86_64', disc_type='dvd'),
mock.call(compose, 'amd64', disc_type='dvd')])
[mock.call(compose, 'x86_64', disc_type='DVD'),
mock.call(compose, 'amd64', disc_type='DVD')])
def test_global_upgrade_with_lorax(self):
compose = BuildInstallCompose(self.topdir, {