Skip to content

Commit

Permalink
Merge pull request #21127 from smithfarm/wip-make-dist-py3
Browse files Browse the repository at this point in the history
build/ops: make-dist: fall back to python3

Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Ricardo Dias <rdias@suse.com>
  • Loading branch information
smithfarm committed Apr 6, 2018
2 parents 2156fd0 + 72c6405 commit 507b872
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion make-dist
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 507b872

Please sign in to comment.