[buildinstall] Rename method to not mention symlinks
It is either hardlinking or copying, so the name is quite misleading. Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
f202d24961
commit
ad104f994a
@ -189,7 +189,7 @@ class BuildinstallPhase(PhaseBase):
|
|||||||
label = ""
|
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="dvd")
|
||||||
tweak_buildinstall(buildinstall_dir, os_tree, arch, variant.uid, label, volid, kickstart_file)
|
tweak_buildinstall(buildinstall_dir, os_tree, arch, variant.uid, label, volid, kickstart_file)
|
||||||
symlink_boot_iso(self.compose, arch, variant)
|
link_boot_iso(self.compose, arch, variant)
|
||||||
|
|
||||||
|
|
||||||
def get_kickstart_file(compose):
|
def get_kickstart_file(compose):
|
||||||
@ -312,7 +312,7 @@ def tweak_buildinstall(src, dst, arch, variant, label, volid, kickstart_file=Non
|
|||||||
shutil.rmtree(tmp_dir)
|
shutil.rmtree(tmp_dir)
|
||||||
|
|
||||||
|
|
||||||
def symlink_boot_iso(compose, arch, variant):
|
def link_boot_iso(compose, arch, variant):
|
||||||
if arch == "src":
|
if arch == "src":
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -323,7 +323,7 @@ def symlink_boot_iso(compose, arch, variant):
|
|||||||
if not os.path.isfile(boot_iso_path):
|
if not os.path.isfile(boot_iso_path):
|
||||||
return
|
return
|
||||||
|
|
||||||
msg = "Symlinking boot.iso (arch: %s, variant: %s)" % (arch, variant)
|
msg = "Linking boot.iso (arch: %s, variant: %s)" % (arch, variant)
|
||||||
filename = compose.get_image_name(arch, variant, disc_type="boot",
|
filename = compose.get_image_name(arch, variant, disc_type="boot",
|
||||||
disc_num=None, suffix=".iso")
|
disc_num=None, suffix=".iso")
|
||||||
new_boot_iso_path = compose.paths.compose.iso_path(arch, variant, filename,
|
new_boot_iso_path = compose.paths.compose.iso_path(arch, variant, filename,
|
||||||
|
@ -10,7 +10,7 @@ import sys
|
|||||||
|
|
||||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
|
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
|
||||||
|
|
||||||
from pungi.phases.buildinstall import BuildinstallPhase, BuildinstallThread, symlink_boot_iso
|
from pungi.phases.buildinstall import BuildinstallPhase, BuildinstallThread, link_boot_iso
|
||||||
from tests.helpers import DummyCompose, PungiTestCase, touch
|
from tests.helpers import DummyCompose, PungiTestCase, touch
|
||||||
|
|
||||||
|
|
||||||
@ -312,14 +312,14 @@ class TestBuildinstallPhase(PungiTestCase):
|
|||||||
|
|
||||||
class TestCopyFiles(PungiTestCase):
|
class TestCopyFiles(PungiTestCase):
|
||||||
|
|
||||||
@mock.patch('pungi.phases.buildinstall.symlink_boot_iso')
|
@mock.patch('pungi.phases.buildinstall.link_boot_iso')
|
||||||
@mock.patch('pungi.phases.buildinstall.tweak_buildinstall')
|
@mock.patch('pungi.phases.buildinstall.tweak_buildinstall')
|
||||||
@mock.patch('pungi.phases.buildinstall.get_volid')
|
@mock.patch('pungi.phases.buildinstall.get_volid')
|
||||||
@mock.patch('os.listdir')
|
@mock.patch('os.listdir')
|
||||||
@mock.patch('os.path.isdir')
|
@mock.patch('os.path.isdir')
|
||||||
@mock.patch('pungi.phases.buildinstall.get_kickstart_file')
|
@mock.patch('pungi.phases.buildinstall.get_kickstart_file')
|
||||||
def test_copy_files_buildinstall(self, get_kickstart_file, isdir, listdir,
|
def test_copy_files_buildinstall(self, get_kickstart_file, isdir, listdir,
|
||||||
get_volid, tweak_buildinstall, symlink_boot_iso):
|
get_volid, tweak_buildinstall, link_boot_iso):
|
||||||
compose = BuildInstallCompose(self.topdir, {
|
compose = BuildInstallCompose(self.topdir, {
|
||||||
'buildinstall_method': 'buildinstall'
|
'buildinstall_method': 'buildinstall'
|
||||||
})
|
})
|
||||||
@ -349,19 +349,19 @@ class TestCopyFiles(PungiTestCase):
|
|||||||
self.topdir + '/compose/Client/amd64/os',
|
self.topdir + '/compose/Client/amd64/os',
|
||||||
'amd64', 'Client', '', 'Client.amd64', 'kickstart')])
|
'amd64', 'Client', '', 'Client.amd64', 'kickstart')])
|
||||||
self.assertItemsEqual(
|
self.assertItemsEqual(
|
||||||
symlink_boot_iso.mock_calls,
|
link_boot_iso.mock_calls,
|
||||||
[mock.call(compose, 'x86_64', compose.variants['Server']),
|
[mock.call(compose, 'x86_64', compose.variants['Server']),
|
||||||
mock.call(compose, 'amd64', compose.variants['Client']),
|
mock.call(compose, 'amd64', compose.variants['Client']),
|
||||||
mock.call(compose, 'amd64', compose.variants['Server'])])
|
mock.call(compose, 'amd64', compose.variants['Server'])])
|
||||||
|
|
||||||
@mock.patch('pungi.phases.buildinstall.symlink_boot_iso')
|
@mock.patch('pungi.phases.buildinstall.link_boot_iso')
|
||||||
@mock.patch('pungi.phases.buildinstall.tweak_buildinstall')
|
@mock.patch('pungi.phases.buildinstall.tweak_buildinstall')
|
||||||
@mock.patch('pungi.phases.buildinstall.get_volid')
|
@mock.patch('pungi.phases.buildinstall.get_volid')
|
||||||
@mock.patch('os.listdir')
|
@mock.patch('os.listdir')
|
||||||
@mock.patch('os.path.isdir')
|
@mock.patch('os.path.isdir')
|
||||||
@mock.patch('pungi.phases.buildinstall.get_kickstart_file')
|
@mock.patch('pungi.phases.buildinstall.get_kickstart_file')
|
||||||
def test_copy_files_lorax(self, get_kickstart_file, isdir, listdir,
|
def test_copy_files_lorax(self, get_kickstart_file, isdir, listdir,
|
||||||
get_volid, tweak_buildinstall, symlink_boot_iso):
|
get_volid, tweak_buildinstall, link_boot_iso):
|
||||||
compose = BuildInstallCompose(self.topdir, {
|
compose = BuildInstallCompose(self.topdir, {
|
||||||
'buildinstall_method': 'lorax'
|
'buildinstall_method': 'lorax'
|
||||||
})
|
})
|
||||||
@ -391,7 +391,7 @@ class TestCopyFiles(PungiTestCase):
|
|||||||
self.topdir + '/compose/Client/amd64/os',
|
self.topdir + '/compose/Client/amd64/os',
|
||||||
'amd64', 'Client', '', 'Client.amd64', 'kickstart')])
|
'amd64', 'Client', '', 'Client.amd64', 'kickstart')])
|
||||||
self.assertItemsEqual(
|
self.assertItemsEqual(
|
||||||
symlink_boot_iso.mock_calls,
|
link_boot_iso.mock_calls,
|
||||||
[mock.call(compose, 'x86_64', compose.variants['Server']),
|
[mock.call(compose, 'x86_64', compose.variants['Server']),
|
||||||
mock.call(compose, 'amd64', compose.variants['Client']),
|
mock.call(compose, 'amd64', compose.variants['Client']),
|
||||||
mock.call(compose, 'amd64', compose.variants['Server'])])
|
mock.call(compose, 'amd64', compose.variants['Server'])])
|
||||||
@ -576,7 +576,7 @@ class TestSymlinkIso(PungiTestCase):
|
|||||||
get_file_size.return_value = 1024
|
get_file_size.return_value = 1024
|
||||||
get_mtime.return_value = 13579
|
get_mtime.return_value = 13579
|
||||||
|
|
||||||
symlink_boot_iso(self.compose, 'x86_64', self.compose.variants['Server'])
|
link_boot_iso(self.compose, 'x86_64', self.compose.variants['Server'])
|
||||||
|
|
||||||
tgt = self.topdir + '/compose/Server/x86_64/iso/image-name'
|
tgt = self.topdir + '/compose/Server/x86_64/iso/image-name'
|
||||||
self.assertTrue(os.path.isfile(tgt))
|
self.assertTrue(os.path.isfile(tgt))
|
||||||
|
Loading…
Reference in New Issue
Block a user