createiso: Use correct python version

On some systems we need to use python3, in other places it can be
another version. Instead of guessing, let's look at shebang line in
lorax executable and use the same.

JIRA: COMPOSE-2852
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2018-08-15 08:28:36 +02:00
parent b85cd7ff9f
commit ac0d5e4ede
3 changed files with 3 additions and 3 deletions

View File

@ -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', '')

View File

@ -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"]])

View File

@ -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,