undercloud: python3 support for custom envs

We don't hardcode "python" anymore to run process_templates during the
pre-flight in _validate_env_files_paths, we now compute the python
version to execute with the right python binary.

Change-Id: Ie953cc8379532faa314b344d5423af672ab9d34d
This commit is contained in:
Emilien Macchi 2019-03-18 09:58:28 -04:00
parent dbce4e9e64
commit 68250f7097
1 changed files with 3 additions and 1 deletions

View File

@ -352,8 +352,10 @@ def _validate_env_files_paths():
LOG.debug(_("Using roles file {0} from {1}").format(roles_file, tht_path))
process_templates = os.path.join(tht_path,
'tools/process-templates.py')
python_interpreter = "/usr/bin/python{}".format(sys.version_info[0])
p = _run_live_command(
['python', process_templates, '--roles-data', roles_file, '--dry-run'],
[python_interpreter, process_templates, '--roles-data', roles_file,
'--dry-run'],
name='process-templates-dry-run', cwd=tht_path, wait=False)
# parse the list for the rendered from j2 file names