From f06231ee087d908786fb8826f0dbc5527f09fd3c Mon Sep 17 00:00:00 2001 From: Adam Harwell Date: Sat, 25 Mar 2017 00:16:22 +0900 Subject: [PATCH] Use DIB_PYTHON_EXEC to run commands DIB_PYTHON_EXEC was added in I5fab0e192c3a2dad8f60e821c184479e24e33bcd to export the python that disk-image-create is running under. If dib is installed with python3 then just calls "python" (python2) to run sub-scripts, it fails to find itself. This has been tested in devstack gates that use py3x Change-Id: Ia1028972bfc0517b468b279aab9decdbcd7424ca --- diskimage_builder/lib/disk-image-create | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/diskimage_builder/lib/disk-image-create b/diskimage_builder/lib/disk-image-create index 5fc40143..564077d2 100644 --- a/diskimage_builder/lib/disk-image-create +++ b/diskimage_builder/lib/disk-image-create @@ -31,7 +31,7 @@ if [ -z "$_LIB" ]; then exit 1 fi -_BASE_ELEMENT_DIR=$(python -c ' +_BASE_ELEMENT_DIR=$(${DIB_PYTHON_EXEC:-python} -c ' import diskimage_builder.paths diskimage_builder.paths.show_path("elements")') @@ -104,7 +104,7 @@ function show_options () { } function show_version() { - python -c "from diskimage_builder import version; print(version.version_info.version_string())" + ${DIB_PYTHON_EXEC:-python} -c "from diskimage_builder import version; print(version.version_info.version_string())" } DIB_DEBUG_TRACE=${DIB_DEBUG_TRACE:-0}