diskimage-builder/elements/dib-python/pre-install.d/01-dib-python
Ben Nemec 1b0ca07d86 Force dib-python symlink creation
The undercloud actually has dib run twice on it - once to create
the instack image, and again when we run instack itself.  The
first run creates the dib-python symlink, and the second blows up
because the link already exists.  Force the link creation so the
script is idempotent.

Change-Id: I78f9e6f5afcf8ebe6d7911a7a434525ba7c737cf
2016-01-21 13:25:33 -06:00

15 lines
298 B
Bash
Executable file

#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
python_path=$(command -v python2 || command -v python3)
if [ -z "$python_path" ]; then
echo "Could not find python2 or python3 executable."
exit 1
fi
ln -sf $python_path /usr/local/bin/dib-python