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
changes/50/643950/2
Emilien Macchi 4 years ago
parent dbce4e9e64
commit 68250f7097
  1. 4
      tripleoclient/v1/undercloud_preflight.py

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

Loading…
Cancel
Save