diff --git a/pungi/createiso.py b/pungi/createiso.py index 90da6cf7..d079b778 100644 --- a/pungi/createiso.py +++ b/pungi/createiso.py @@ -35,7 +35,7 @@ def emit(f, cmd): FIND_TEMPLATE_SNIPPET = """ -if ! TEMPLATE="$(python3 -c 'import pylorax; print(pylorax.find_templates())')"; then +if ! TEMPLATE="$($(head -n1 $(which lorax) | cut -c3-) -c 'import pylorax; print(pylorax.find_templates())')"; then TEMPLATE=/usr/share/lorax; fi """.replace('\n', '') diff --git a/pungi/phases/createiso.py b/pungi/phases/createiso.py index aa39152a..328b543b 100644 --- a/pungi/phases/createiso.py +++ b/pungi/phases/createiso.py @@ -258,7 +258,7 @@ def run_createiso_command(runroot, num, compose, bootable, arch, cmd, mounts, packages.append('jigdo') if bootable: extra_packages = { - 'lorax': ['lorax'], + 'lorax': ['lorax', 'which'], 'buildinstall': ['anaconda'], } packages.extend(extra_packages[compose.conf["buildinstall_method"]]) diff --git a/tests/test_createiso_phase.py b/tests/test_createiso_phase.py index 474ee154..c3597820 100644 --- a/tests/test_createiso_phase.py +++ b/tests/test_createiso_phase.py @@ -448,7 +448,7 @@ class CreateisoThreadTest(helpers.PungiTestCase): [mock.call('f25-build', 'x86_64', cmd['cmd'], channel=None, mounts=[self.topdir], packages=['coreutils', 'genisoimage', 'isomd5sum', - 'jigdo', 'lorax'], + 'jigdo', 'lorax', 'which'], task_id=True, use_shell=True, weight=None)]) self.assertEqual( run_runroot.call_args_list,