From: Kefu Chai Date: Mon, 26 Feb 2018 06:38:49 +0000 (+0800) Subject: qa/run-standalone.sh: pass PYTHONPATH env var to test X-Git-Tag: v13.0.2~145^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F20589%2Fhead;p=ceph.git qa/run-standalone.sh: pass PYTHONPATH env var to test otherwise ceph-mgr will refuse to start if the required python binding, a.k.a mgr_module is not available in default sys.path. Signed-off-by: Kefu Chai --- diff --git a/qa/run-standalone.sh b/qa/run-standalone.sh index aef60b6e0584..909130891522 100755 --- a/qa/run-standalone.sh +++ b/qa/run-standalone.sh @@ -12,6 +12,25 @@ if [ ! -d $TEMP_DIR/ceph-disk-virtualenv -o ! -d $TEMP_DIR/ceph-detect-init-virt exit 1 fi +function get_cmake_variable() { + local variable=$1 + grep "$variable" CMakeCache.txt | cut -d "=" -f 2 +} + +function cython_module_path() { + local ceph_lib=$1 + shift + local py_ver=$(get_cmake_variable MGR_PYTHON_VERSION | cut -d '.' -f1) + if [ -z "${py_ver}" ]; then + if [ $(get_cmake_variable WITH_PYTHON2) = ON ]; then + py_ver=2 + else + py_ver=3 + fi + fi + echo $ceph_lib/cython_modules/lib.$py_ver +} + if [ `uname` = FreeBSD ]; then # otherwise module prettytable will not be found export PYTHONPATH=/usr/local/lib/python2.7/site-packages @@ -104,6 +123,7 @@ do if ! PATH=$PATH:bin \ CEPH_ROOT=.. \ CEPH_LIB=lib \ + PYTHONPATH=$(realpath ../src/pybind):$(cython_module_path lib) \ LOCALRUN=yes \ $cmd ; then echo "$f .............. FAILED"