diff --git a/be/src/codegen/gen_ir_descriptions.py b/be/src/codegen/gen_ir_descriptions.py index 62fda01fbb..c62ae8b9d1 100755 --- a/be/src/codegen/gen_ir_descriptions.py +++ b/be/src/codegen/gen_ir_descriptions.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap # This uses system python to avoid a dependency on impala-python, # because this runs during the build. # diff --git a/bin/bootstrap_toolchain.py b/bin/bootstrap_toolchain.py index bbd09388e9..f5aca9a725 100755 --- a/bin/bootstrap_toolchain.py +++ b/bin/bootstrap_toolchain.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information diff --git a/bin/check-rat-report.py b/bin/check-rat-report.py index b3781928f7..23cfab2e0c 100755 --- a/bin/check-rat-report.py +++ b/bin/check-rat-report.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env ambari-python-wrap # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file diff --git a/bin/collect_minidumps.py b/bin/collect_minidumps.py index 57bc50f3ff..4aa00cd223 100755 --- a/bin/collect_minidumps.py +++ b/bin/collect_minidumps.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information diff --git a/bin/compare_branches.py b/bin/compare_branches.py index 5fcb3fbbe7..b8d1e652f0 100755 --- a/bin/compare_branches.py +++ b/bin/compare_branches.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/bin/create-test-configuration.sh b/bin/create-test-configuration.sh index cb44891498..41e09aeb3d 100755 --- a/bin/create-test-configuration.sh +++ b/bin/create-test-configuration.sh @@ -205,7 +205,7 @@ if [ $CREATE_RANGER_POLICY_DB -eq 1 ]; then createdb -U hiveuser "${RANGER_POLICY_DB}" pushd "${RANGER_HOME}" generate_config "${RANGER_TEST_CONF_DIR}/install.properties.template" install.properties - python ./db_setup.py + ambari-python-wrap ./db_setup.py popd fi diff --git a/bin/diagnostics/collect_diagnostics.py b/bin/diagnostics/collect_diagnostics.py index 2257d6ff58..226cb6cbc5 100755 --- a/bin/diagnostics/collect_diagnostics.py +++ b/bin/diagnostics/collect_diagnostics.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env ambari-python-wrap # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file diff --git a/bin/diagnostics/experimental/plan-graph.py b/bin/diagnostics/experimental/plan-graph.py index 03e06d6631..b5e2857bc9 100755 --- a/bin/diagnostics/experimental/plan-graph.py +++ b/bin/diagnostics/experimental/plan-graph.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env ambari-python-wrap # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file diff --git a/bin/diagnostics/experimental/tpcds_run_comparator.py b/bin/diagnostics/experimental/tpcds_run_comparator.py index 80b787f0ff..4bceaaf38b 100755 --- a/bin/diagnostics/experimental/tpcds_run_comparator.py +++ b/bin/diagnostics/experimental/tpcds_run_comparator.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env ambari-python-wrap # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file diff --git a/bin/gen-backend-test-script.py b/bin/gen-backend-test-script.py index 6e572a8396..1f7a4d0463 100755 --- a/bin/gen-backend-test-script.py +++ b/bin/gen-backend-test-script.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information diff --git a/bin/gen_build_version.py b/bin/gen_build_version.py index 3f4f62b1cf..6887bf0428 100755 --- a/bin/gen_build_version.py +++ b/bin/gen_build_version.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap # This uses system python to avoid a dependency on impala-python, # because this runs during the build. # diff --git a/bin/generate_xml_config.py b/bin/generate_xml_config.py index d4e7e6561a..6eb87c159a 100755 --- a/bin/generate_xml_config.py +++ b/bin/generate_xml_config.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file diff --git a/bin/impala-config.sh b/bin/impala-config.sh index 63fdc0d101..e440b487ac 100755 --- a/bin/impala-config.sh +++ b/bin/impala-config.sh @@ -237,9 +237,37 @@ export IMPALA_THRIFT_PY_VERSION=0.16.0-p7 unset IMPALA_THRIFT_PY_URL # Find system python versions for testing -export IMPALA_SYSTEM_PYTHON2="${IMPALA_SYSTEM_PYTHON2_OVERRIDE-$(command -v python2)}" -export IMPALA_SYSTEM_PYTHON3="${IMPALA_SYSTEM_PYTHON3_OVERRIDE-$(command -v python3)}" +if command -v python2 >/dev/null || [ -n "$IMPALA_SYSTEM_PYTHON2_OVERRIDE" ]; then + export IMPALA_SYSTEM_PYTHON2="${IMPALA_SYSTEM_PYTHON2_OVERRIDE-$(command -v python2)}" +fi + +if command -v ambari-python-wrap >/dev/null || [ -n "$IMPALA_SYSTEM_PYTHON3_OVERRIDE" ]; then + # Extract major python version from ambari-python-wrap + PYTHON_VER=$($(command -v ambari-python-wrap) --version 2>&1 | tr -s '[:blank:]' . | cut -d '.' -f2) + + if printf "%s" "$PYTHON_VER" | grep "^[23]$" >/dev/null && [ "$PYTHON_VER" -eq 3 ] 2>/dev/null && [ -z "$IMPALA_SYSTEM_PYTHON3_OVERRIDE" ]; then + mkdir -p /tmp/acceldata-python/ + \rm -f /tmp/acceldata-python/python3 + # CMakeLists.txt expects the binary to match exactly python3, so we create a symlink + ln -sv "$(command -v ambari-python-wrap)" /tmp/acceldata-python/python3 + export IMPALA_SYSTEM_PYTHON3="/tmp/acceldata-python/python3" + else + export IMPALA_SYSTEM_PYTHON3="$IMPALA_SYSTEM_PYTHON3_OVERRIDE" + fi +fi + +if [ -z "$IMPALA_SYSTEM_PYTHON2" ] && [ -z "$IMPALA_SYSTEM_PYTHON3" ]; then + printf "Python 2 was not found in PATH\n" >&2 + printf "ambari-python-wrap not found in PATH.\n" >&2 + printf "Neither IMPALA_SYSTEM_PYTHON2_OVERRIDE or IMPALA_SYSTEM_PYTHON3_OVERRIDE have been set\n" >&2 + printf "At least one of these must be true to continue bulding impala\n" >&2 + exit 1 +elif [ -z "$IMPALA_SYSTEM_PYTHON3" ]; then + printf "Skipping configuration for python 3\n" +elif [ -z "$IMPALA_SYSTEM_PYTHON2" ]; then + printf "Skipping configuration for python 2\n" +fi # Additional Python versions to use when building the impala-shell prebuilt tarball # via make_shell_tarball.sh. That tarball includes precompiled packages, so it can be # used without additional system dependencies needed for pip install. diff --git a/bin/impala-python-common.sh b/bin/impala-python-common.sh index 4026029fab..b84fea6668 100644 --- a/bin/impala-python-common.sh +++ b/bin/impala-python-common.sh @@ -23,10 +23,9 @@ set -euo pipefail setup_report_build_error . $IMPALA_HOME/bin/set-pythonpath.sh - -export LD_LIBRARY_PATH="$(python "$IMPALA_HOME/infra/python/bootstrap_virtualenv.py" \ +export LD_LIBRARY_PATH="$(ambari-python-wrap "$IMPALA_HOME/infra/python/bootstrap_virtualenv.py" \ --print-ld-library-path)" PY_DIR="$(dirname "$0")/../infra/python" PY_ENV_DIR="${PY_DIR}/env-gcc${IMPALA_GCC_VERSION}" -python "$PY_DIR/bootstrap_virtualenv.py" +ambari-python-wrap "$PY_DIR/bootstrap_virtualenv.py" diff --git a/bin/impala-python3-common.sh b/bin/impala-python3-common.sh index 06bf3a87ac..66db10cfe7 100644 --- a/bin/impala-python3-common.sh +++ b/bin/impala-python3-common.sh @@ -24,9 +24,9 @@ setup_report_build_error . $IMPALA_HOME/bin/set-pythonpath.sh -export LD_LIBRARY_PATH="$(python "$IMPALA_HOME/infra/python/bootstrap_virtualenv.py" \ +export LD_LIBRARY_PATH="$(ambari-python-wrap "$IMPALA_HOME/infra/python/bootstrap_virtualenv.py" \ --print-ld-library-path)" PY_DIR="$(dirname "$0")/../infra/python" PY_ENV_DIR="${PY_DIR}/env-gcc${IMPALA_GCC_VERSION}-py3" -python "$PY_DIR/bootstrap_virtualenv.py" --python3 +ambari-python-wrap "$PY_DIR/bootstrap_virtualenv.py" --python3 diff --git a/bin/impala-shell.sh b/bin/impala-shell.sh index a495d9ca79..fc267f7af4 100755 --- a/bin/impala-shell.sh +++ b/bin/impala-shell.sh @@ -30,9 +30,8 @@ PYTHONPATH=${PYTHONPATH}:${IMPALA_HOME}/bin PYTHONPATH=${PYTHONPATH}:${SHELL_HOME}/gen-py THRIFT_PY_ROOT="${IMPALA_TOOLCHAIN_PACKAGES_HOME}/thrift-${IMPALA_THRIFT_PY_VERSION}" - export LD_LIBRARY_PATH=":$(PYTHONPATH=${PYTHONPATH} \ - python "$IMPALA_HOME/infra/python/bootstrap_virtualenv.py" \ + ambari-python-wrap "$IMPALA_HOME/infra/python/bootstrap_virtualenv.py" \ --print-ld-library-path)" IMPALA_PY_DIR="$(dirname "$0")/../infra/python" @@ -48,7 +47,7 @@ for PYTHON_LIB_DIR in ${THRIFT_PY_ROOT}/python/lib{64,}; do done # Note that this uses the external system python executable -PYTHONPATH=${PYTHONPATH} python "${IMPALA_PY_DIR}/bootstrap_virtualenv.py" +PYTHONPATH=${PYTHONPATH} ambari-python-wrap "${IMPALA_PY_DIR}/bootstrap_virtualenv.py" # Enable remote debugging if port was specified via environment variable if [[ ${IMPALA_SHELL_DEBUG_PORT:-0} -ne 0 ]]; then diff --git a/bin/jenkins/critique-gerrit-review.py b/bin/jenkins/critique-gerrit-review.py index c165017c4c..c03205d29e 100755 --- a/bin/jenkins/critique-gerrit-review.py +++ b/bin/jenkins/critique-gerrit-review.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env ambari-python-wrap # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information diff --git a/bin/jenkins/dockerized-impala-preserve-vars.py b/bin/jenkins/dockerized-impala-preserve-vars.py index 53bfe61dc8..beef04a68f 100755 --- a/bin/jenkins/dockerized-impala-preserve-vars.py +++ b/bin/jenkins/dockerized-impala-preserve-vars.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file diff --git a/bin/jenkins/populate_m2_directory.py b/bin/jenkins/populate_m2_directory.py index 6b8f526ce9..ce132b0862 100755 --- a/bin/jenkins/populate_m2_directory.py +++ b/bin/jenkins/populate_m2_directory.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env ambari-python-wrap # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information diff --git a/bin/push_to_asf.py b/bin/push_to_asf.py index 4e2803f0b0..a0603f4f79 100755 --- a/bin/push_to_asf.py +++ b/bin/push_to_asf.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env ambari-python-wrap # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file diff --git a/bin/resolve_minidumps.py b/bin/resolve_minidumps.py index 3c64d9d559..64cefccaea 100755 --- a/bin/resolve_minidumps.py +++ b/bin/resolve_minidumps.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env ambari-python-wrap # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file diff --git a/bin/validate-unified-backend-test-filters.py b/bin/validate-unified-backend-test-filters.py index 42db3bf36e..4de4005cba 100755 --- a/bin/validate-unified-backend-test-filters.py +++ b/bin/validate-unified-backend-test-filters.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file diff --git a/common/function-registry/gen_builtins_catalog.py b/common/function-registry/gen_builtins_catalog.py index 485c47365e..b45ce0bbc9 100755 --- a/common/function-registry/gen_builtins_catalog.py +++ b/common/function-registry/gen_builtins_catalog.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file diff --git a/common/function-registry/gen_geospatial_udf_wrappers.py b/common/function-registry/gen_geospatial_udf_wrappers.py index 19fa0191d3..b469eafdd7 100755 --- a/common/function-registry/gen_geospatial_udf_wrappers.py +++ b/common/function-registry/gen_geospatial_udf_wrappers.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file diff --git a/common/thrift/generate_error_codes.py b/common/thrift/generate_error_codes.py index 7a1a172b28..e3c33e2406 100755 --- a/common/thrift/generate_error_codes.py +++ b/common/thrift/generate_error_codes.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file diff --git a/common/thrift/generate_metrics.py b/common/thrift/generate_metrics.py index 6aa02822f4..440773c2ad 100755 --- a/common/thrift/generate_metrics.py +++ b/common/thrift/generate_metrics.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file diff --git a/docker/annotate.py b/docker/annotate.py index c7f6b13fac..e2cba27758 100755 --- a/docker/annotate.py +++ b/docker/annotate.py @@ -1,4 +1,4 @@ -#!/usr/bin/python -u +#!/usr/bin/env ambari-python-wrap # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file diff --git a/docker/monitor.py b/docker/monitor.py index f1692376de..0212b5fdac 100644 --- a/docker/monitor.py +++ b/docker/monitor.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env ambari-python-wrap # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file diff --git a/docker/test-with-docker.py b/docker/test-with-docker.py index c7377f452e..62ea4ec8a7 100755 --- a/docker/test-with-docker.py +++ b/docker/test-with-docker.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env ambari-python-wrap # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file diff --git a/fe/src/test/resources/hive-site.xml.py b/fe/src/test/resources/hive-site.xml.py index 9b9c2dbfd8..1676b200f3 100644 --- a/fe/src/test/resources/hive-site.xml.py +++ b/fe/src/test/resources/hive-site.xml.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file diff --git a/infra/python/deps/pip_download.py b/infra/python/deps/pip_download.py index 2d965ac33c..1ac60ef6a1 100755 --- a/infra/python/deps/pip_download.py +++ b/infra/python/deps/pip_download.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env ambari-python-wrap # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file diff --git a/lib/python/impala_py_lib/jenkins/generate_junitxml.py b/lib/python/impala_py_lib/jenkins/generate_junitxml.py index 9382d8ac33..a091e486fb 100755 --- a/lib/python/impala_py_lib/jenkins/generate_junitxml.py +++ b/lib/python/impala_py_lib/jenkins/generate_junitxml.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information diff --git a/lib/python/impala_py_lib/jenkins/junitxml_prune_notrun.py b/lib/python/impala_py_lib/jenkins/junitxml_prune_notrun.py index 3abfb88230..5b1013d166 100755 --- a/lib/python/impala_py_lib/jenkins/junitxml_prune_notrun.py +++ b/lib/python/impala_py_lib/jenkins/junitxml_prune_notrun.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file diff --git a/lib/python/setup.py b/lib/python/setup.py index c2b3cecc82..c3111f48b9 100644 --- a/lib/python/setup.py +++ b/lib/python/setup.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap # -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one diff --git a/shell/TSSLSocketWithWildcardSAN.py b/shell/TSSLSocketWithWildcardSAN.py index 95998711e4..fc617af27c 100755 --- a/shell/TSSLSocketWithWildcardSAN.py +++ b/shell/TSSLSocketWithWildcardSAN.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file diff --git a/shell/compatibility.py b/shell/compatibility.py index 829c204fb2..1bb5b2cd23 100644 --- a/shell/compatibility.py +++ b/shell/compatibility.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap # -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one diff --git a/shell/ext-py/prettytable-0.7.2/prettytable.py b/shell/ext-py/prettytable-0.7.2/prettytable.py index 8abb952b9b..5baca789c7 100644 --- a/shell/ext-py/prettytable-0.7.2/prettytable.py +++ b/shell/ext-py/prettytable-0.7.2/prettytable.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap # # Copyright (c) 2009-2013, Luke Maurits # All rights reserved. diff --git a/shell/ext-py/prettytable-0.7.2/setup.py b/shell/ext-py/prettytable-0.7.2/setup.py index 20a2322c4f..bd05131ec4 100644 --- a/shell/ext-py/prettytable-0.7.2/setup.py +++ b/shell/ext-py/prettytable-0.7.2/setup.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap from setuptools import setup from prettytable import __version__ as version diff --git a/shell/ext-py/sqlparse-0.3.1/setup.py b/shell/ext-py/sqlparse-0.3.1/setup.py index 3de94e7baa..1065a7a5bb 100644 --- a/shell/ext-py/sqlparse-0.3.1/setup.py +++ b/shell/ext-py/sqlparse-0.3.1/setup.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap # -*- coding: utf-8 -*- # # Copyright (C) 2009-2018 the sqlparse authors and contributors diff --git a/shell/ext-py/sqlparse-0.3.1/sqlparse/__main__.py b/shell/ext-py/sqlparse-0.3.1/sqlparse/__main__.py index 867d75d5f8..1962131d02 100644 --- a/shell/ext-py/sqlparse-0.3.1/sqlparse/__main__.py +++ b/shell/ext-py/sqlparse-0.3.1/sqlparse/__main__.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap # -*- coding: utf-8 -*- # # Copyright (C) 2009-2018 the sqlparse authors and contributors diff --git a/shell/ext-py/sqlparse-0.3.1/sqlparse/cli.py b/shell/ext-py/sqlparse-0.3.1/sqlparse/cli.py index 25555a591b..5fff0417c6 100755 --- a/shell/ext-py/sqlparse-0.3.1/sqlparse/cli.py +++ b/shell/ext-py/sqlparse-0.3.1/sqlparse/cli.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap # -*- coding: utf-8 -*- # # Copyright (C) 2009-2018 the sqlparse authors and contributors diff --git a/shell/ext-py/thrift-0.16.0/setup.py b/shell/ext-py/thrift-0.16.0/setup.py index 7cd4a2e901..3123f8a3c9 100644 --- a/shell/ext-py/thrift-0.16.0/setup.py +++ b/shell/ext-py/thrift-0.16.0/setup.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap # # Licensed to the Apache Software Foundation (ASF) under one diff --git a/shell/impala-shell b/shell/impala-shell index 7f8e385f9c..dfd277ec4c 100755 --- a/shell/impala-shell +++ b/shell/impala-shell @@ -37,7 +37,7 @@ SHELL_HOME=${IMPALA_SHELL_HOME:-${SCRIPT_DIR}} export LC_CTYPE=${LC_CTYPE:-en_US.UTF-8} # Select python version; prefer 2, use 3 if 2's absent. Allow override with envvar -PYTHON_EXE="${IMPALA_PYTHON_EXECUTABLE:-python}" +PYTHON_EXE="${IMPALA_PYTHON_EXECUTABLE:-ambari-python-wrap}" if ! command -v "${PYTHON_EXE}" > /dev/null; then PYTHON_EXE=python3 fi diff --git a/shell/impala_client.py b/shell/impala_client.py index 8ec1d72ab4..28b494d487 100755 --- a/shell/impala_client.py +++ b/shell/impala_client.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap # -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one diff --git a/shell/impala_shell.py b/shell/impala_shell.py index 7998fce534..31bb42442b 100755 --- a/shell/impala_shell.py +++ b/shell/impala_shell.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap # -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one diff --git a/shell/impala_shell_config_defaults.py b/shell/impala_shell_config_defaults.py index b07cd86a6b..d20fc05ec0 100644 --- a/shell/impala_shell_config_defaults.py +++ b/shell/impala_shell_config_defaults.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap # -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one diff --git a/shell/option_parser.py b/shell/option_parser.py index a587596ced..51a7af04e9 100755 --- a/shell/option_parser.py +++ b/shell/option_parser.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap # -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one diff --git a/shell/packaging/__init__.py b/shell/packaging/__init__.py index 43e0baa1f6..670036d0ec 100644 --- a/shell/packaging/__init__.py +++ b/shell/packaging/__init__.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file diff --git a/shell/packaging/setup.py b/shell/packaging/setup.py index ec53615a98..1b3b0c9d88 100644 --- a/shell/packaging/setup.py +++ b/shell/packaging/setup.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap # -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one diff --git a/shell/shell_output.py b/shell/shell_output.py index 070f66910c..ea9b0b2aa6 100644 --- a/shell/shell_output.py +++ b/shell/shell_output.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap # -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one diff --git a/testdata/cluster/node_templates/common/etc/hadoop/conf/core-site.xml.py b/testdata/cluster/node_templates/common/etc/hadoop/conf/core-site.xml.py index 72f1ac2333..21ec70c898 100644 --- a/testdata/cluster/node_templates/common/etc/hadoop/conf/core-site.xml.py +++ b/testdata/cluster/node_templates/common/etc/hadoop/conf/core-site.xml.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file diff --git a/testdata/cluster/node_templates/common/etc/hadoop/conf/ozone-site.xml.py b/testdata/cluster/node_templates/common/etc/hadoop/conf/ozone-site.xml.py index de647278ec..1f1f69aab4 100644 --- a/testdata/cluster/node_templates/common/etc/hadoop/conf/ozone-site.xml.py +++ b/testdata/cluster/node_templates/common/etc/hadoop/conf/ozone-site.xml.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file diff --git a/testdata/cluster/node_templates/common/etc/hadoop/conf/yarn-site.xml.py b/testdata/cluster/node_templates/common/etc/hadoop/conf/yarn-site.xml.py index dbcd9f9be2..69305e308c 100644 --- a/testdata/cluster/node_templates/common/etc/hadoop/conf/yarn-site.xml.py +++ b/testdata/cluster/node_templates/common/etc/hadoop/conf/yarn-site.xml.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file diff --git a/tests/comparison/data_generator_mapper.py b/tests/comparison/data_generator_mapper.py index 35d412701d..0922e8403c 100755 --- a/tests/comparison/data_generator_mapper.py +++ b/tests/comparison/data_generator_mapper.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ambari-python-wrap # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file diff --git a/tests/comparison/data_generator_reducer.py b/tests/comparison/data_generator_reducer.py index 8bd6b9debe..6167ee7a29 100755 --- a/tests/comparison/data_generator_reducer.py +++ b/tests/comparison/data_generator_reducer.py @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env ambari-python-wrap # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file diff --git a/tests/shell/util.py b/tests/shell/util.py index 889c075c8d..e429ea151b 100755 --- a/tests/shell/util.py +++ b/tests/shell/util.py @@ -371,7 +371,7 @@ def get_dev_impala_shell_executable(): return os.path.join(IMPALA_HOME, "shell/build", "impala-shell-" + IMPALA_LOCAL_BUILD_VERSION, "impala-shell"), True - +# TODO: ambari-python-wrap testing def create_impala_shell_executable_dimension(dev_only=False): _, include_pypi = get_dev_impala_shell_executable() dimensions = []