summaryrefslogtreecommitdiffstats
path: root/make-dist
diff options
context:
space:
mode:
authorNathan Cutler <ncutler@suse.com>2018-03-29 17:23:40 +0200
committerNathan Cutler <ncutler@suse.com>2018-04-04 19:17:45 +0200
commit72c6405da3c59863f183be066dcd872851f551ca (patch)
tree4ddacd982afd0277a31e238a29507fefcf31575a /make-dist
parentMerge pull request #21146 from zmc/wip-cephmetrics (diff)
downloadceph-72c6405da3c59863f183be066dcd872851f551ca.tar.xz
ceph-72c6405da3c59863f183be066dcd872851f551ca.zip
build/ops: make-dist: fall back to python3
If python2.7 is not available, we might be building in a Python 3-only environment. Signed-off-by: Nathan Cutler <ncutler@suse.com>
Diffstat (limited to 'make-dist')
-rwxr-xr-xmake-dist16
1 files changed, 15 insertions, 1 deletions
diff --git a/make-dist b/make-dist
index f0b3bee1d39..29493b1ffc4 100755
--- a/make-dist
+++ b/make-dist
@@ -61,10 +61,24 @@ download_boost() {
rm -rf src/boost
}
+_python_autoselect() {
+ python_command=
+ for interpreter in python2.7 python3 ; do
+ type $interpreter > /dev/null 2>&1 || continue
+ python_command=$interpreter
+ break
+ done
+ if [ -z "$python_command" ] ; then
+ echo "Could not find a suitable python interpreter! Bailing out."
+ exit 1
+ fi
+ echo $python_command
+}
+
build_dashboard_frontend() {
CURR_DIR=`pwd`
TEMP_DIR=`mktemp -d`
- $CURR_DIR/src/tools/setup-virtualenv.sh --python=python2.7 $TEMP_DIR
+ $CURR_DIR/src/tools/setup-virtualenv.sh --python=$(_python_autoselect) $TEMP_DIR
$TEMP_DIR/bin/pip install nodeenv
$TEMP_DIR/bin/nodeenv -p -n 8.10.0
cd src/pybind/mgr/dashboard/frontend