Allow customizing image name and volume id

The computation of image name has been moved to a separate function.
This allowed simplification in how work dir for isos is computed, but
the result is not changed.

The live image phase has some special casing for names of RPM wrapped
ISOs. This is moved to the actual phase. Since this is (and has been)
undocumented, there should not be many users of this special case.

The documentation is updated to describe how image names and volume ids
are determined and how the process can be customized.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2015-12-10 12:51:18 +01:00
parent 719ec458f4
commit 0e237db5f6
8 changed files with 183 additions and 53 deletions

View file

@ -277,16 +277,18 @@ class TestCopyFiles(unittest.TestCase):
'buildinstall_method': 'buildinstall'
})
get_volid.side_effect = lambda compose, arch, variant, escape_spaces: "%s.%s" % (variant.uid, arch)
get_volid.side_effect = (
lambda compose, arch, variant, escape_spaces, disc_type: "%s.%s" % (variant.uid, arch)
)
get_kickstart_file.return_value = 'kickstart'
phase = BuildinstallPhase(compose)
phase.copy_files()
get_volid.assert_has_calls(
[mock.call(compose, 'x86_64', compose.variants['x86_64'][0], escape_spaces=False),
mock.call(compose, 'amd64', compose.variants['amd64'][0], escape_spaces=False),
mock.call(compose, 'amd64', compose.variants['amd64'][1], escape_spaces=False)],
[mock.call(compose, 'x86_64', compose.variants['x86_64'][0], escape_spaces=False, disc_type='boot'),
mock.call(compose, 'amd64', compose.variants['amd64'][0], escape_spaces=False, disc_type='boot'),
mock.call(compose, 'amd64', compose.variants['amd64'][1], escape_spaces=False, disc_type='boot')],
any_order=True
)
tweak_buildinstall.assert_has_calls(
@ -317,16 +319,18 @@ class TestCopyFiles(unittest.TestCase):
'buildinstall_method': 'lorax'
})
get_volid.side_effect = lambda compose, arch, variant, escape_spaces: "%s.%s" % (variant.uid, arch)
get_volid.side_effect = (
lambda compose, arch, variant, escape_spaces, disc_type: "%s.%s" % (variant.uid, arch)
)
get_kickstart_file.return_value = 'kickstart'
phase = BuildinstallPhase(compose)
phase.copy_files()
get_volid.assert_has_calls(
[mock.call(compose, 'x86_64', compose.variants['x86_64'][0], escape_spaces=False),
mock.call(compose, 'amd64', compose.variants['amd64'][0], escape_spaces=False),
mock.call(compose, 'amd64', compose.variants['amd64'][1], escape_spaces=False)],
[mock.call(compose, 'x86_64', compose.variants['x86_64'][0], escape_spaces=False, disc_type='boot'),
mock.call(compose, 'amd64', compose.variants['amd64'][0], escape_spaces=False, disc_type='boot'),
mock.call(compose, 'amd64', compose.variants['amd64'][1], escape_spaces=False, disc_type='boot')],
any_order=True
)
tweak_buildinstall.assert_has_calls(