diff --git a/pungi/phases/livemedia_phase.py b/pungi/phases/livemedia_phase.py index 1125a1e9..ef544822 100644 --- a/pungi/phases/livemedia_phase.py +++ b/pungi/phases/livemedia_phase.py @@ -159,10 +159,10 @@ class LiveMediaThread(WorkerThread): linker = Linker(logger=compose._logger) link_type = compose.conf.get("link_type", "hardlink-or-copy") for image_info in image_infos: - image_dir = compose.paths.compose.image_dir(variant) % {"arch": image_info['arch']} + image_dir = compose.paths.compose.iso_dir(variant) % {"arch": image_info['arch']} makedirs(image_dir) relative_image_dir = ( - compose.paths.compose.image_dir(variant, relative=True) % {"arch": image_info['arch']} + compose.paths.compose.iso_dir(variant, relative=True) % {"arch": image_info['arch']} ) # let's not change filename of koji outputs diff --git a/tests/test_livemediaphase.py b/tests/test_livemediaphase.py index b72ee5ee..e844a5ad 100755 --- a/tests/test_livemediaphase.py +++ b/tests/test_livemediaphase.py @@ -35,18 +35,12 @@ class _DummyCompose(object): repository=mock.Mock( side_effect=lambda arch, variant, create_dir=False: os.path.join('/repo', arch, variant.uid) ), - image_dir=mock.Mock( + iso_dir=mock.Mock( side_effect=lambda variant, relative=False: os.path.join( - '' if relative else '/', 'image_dir', variant.uid, '%(arch)s' + '' if relative else '/', 'iso_dir', variant.uid, '%(arch)s' ) ) ), - work=mock.Mock( - image_build_conf=mock.Mock( - side_effect=lambda variant, image_name, image_type: - '-'.join([variant.uid, image_name, image_type]) - ) - ), log=mock.Mock( log_file=mock.Mock(return_value='/a/b/log/log_file') ) @@ -237,20 +231,20 @@ class TestCreateImageBuildThread(unittest.TestCase): self.assertEqual(get_image_paths.mock_calls, [mock.call(1234)]) self.assertItemsEqual(makedirs.mock_calls, - [mock.call('/image_dir/Server/x86_64'), - mock.call('/image_dir/Server/amd64')]) + [mock.call('/iso_dir/Server/x86_64'), + mock.call('/iso_dir/Server/amd64')]) link = Linker.return_value.link self.assertItemsEqual(link.mock_calls, [mock.call('/koji/task/1235/Live-20160103.amd64.iso', - '/image_dir/Server/amd64/Live-20160103.amd64.iso', + '/iso_dir/Server/amd64/Live-20160103.amd64.iso', link_type='hardlink-or-copy'), mock.call('/koji/task/1235/Live-20160103.x86_64.iso', - '/image_dir/Server/x86_64/Live-20160103.x86_64.iso', + '/iso_dir/Server/x86_64/Live-20160103.x86_64.iso', link_type='hardlink-or-copy')]) image_relative_paths = [ - 'image_dir/Server/amd64/Live-20160103.amd64.iso', - 'image_dir/Server/x86_64/Live-20160103.x86_64.iso' + 'iso_dir/Server/amd64/Live-20160103.amd64.iso', + 'iso_dir/Server/x86_64/Live-20160103.x86_64.iso' ] self.assertEqual(len(compose.im.add.call_args_list), 2)