Use python3 binary for all operations
When USE_PYTHON3 is True we should use the python3 binary for all the image building process. Change-Id: I92e30ee4018e5412e23caaa786d508674fd99b4f
This commit is contained in:
parent
b32f4ea891
commit
394aec4f79
|
@ -86,14 +86,20 @@ IPA_SOURCE_DIR=${IPA_SOURCE_DIR:-/opt/stack/ironic-python-agent}
|
||||||
cd $IPA_SOURCE_DIR
|
cd $IPA_SOURCE_DIR
|
||||||
rm -rf *.egg-info
|
rm -rf *.egg-info
|
||||||
pwd
|
pwd
|
||||||
python setup.py sdist --dist-dir "$BUILDDIR/tmp/localpip" --quiet
|
|
||||||
|
PYTHON_COMMAND="python"
|
||||||
|
if [[ $USE_PYTHON3 == "True" ]]; then
|
||||||
|
PYTHON_COMMAND="python3"
|
||||||
|
fi
|
||||||
|
$PYTHON_COMMAND setup.py sdist --dist-dir "$BUILDDIR/tmp/localpip" --quiet
|
||||||
|
|
||||||
ls $BUILDDIR/tmp/localpip || true
|
ls $BUILDDIR/tmp/localpip || true
|
||||||
cp requirements.txt $BUILDDIR/tmp/ipa-requirements.txt
|
cp requirements.txt $BUILDDIR/tmp/ipa-requirements.txt
|
||||||
|
|
||||||
if [ -n "$IRONIC_LIB_SOURCE" ]; then
|
if [ -n "$IRONIC_LIB_SOURCE" ]; then
|
||||||
pushd $IRONIC_LIB_SOURCE
|
pushd $IRONIC_LIB_SOURCE
|
||||||
rm -rf *.egg-info
|
rm -rf *.egg-info
|
||||||
python setup.py sdist --dist-dir "$BUILDDIR/tmp/localpip" --quiet
|
$PYTHON_COMMAND setup.py sdist --dist-dir "$BUILDDIR/tmp/localpip" --quiet
|
||||||
cp requirements.txt $BUILDDIR/tmp/ironic-lib-requirements.txt
|
cp requirements.txt $BUILDDIR/tmp/ironic-lib-requirements.txt
|
||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
|
@ -101,10 +107,10 @@ fi
|
||||||
if [ -n "$PYTHON_EXTRA_SOURCES_DIR_LIST" ]; then
|
if [ -n "$PYTHON_EXTRA_SOURCES_DIR_LIST" ]; then
|
||||||
IFS="," read -ra PKGDIRS <<< "$PYTHON_EXTRA_SOURCES_DIR_LIST"
|
IFS="," read -ra PKGDIRS <<< "$PYTHON_EXTRA_SOURCES_DIR_LIST"
|
||||||
for PKGDIR in "${PKGDIRS[@]}"; do
|
for PKGDIR in "${PKGDIRS[@]}"; do
|
||||||
PKG=$(cd "$PKGDIR" ; python setup.py --name)
|
PKG=$(cd "$PKGDIR" ; $PYTHON_COMMAND setup.py --name)
|
||||||
pushd "$PKGDIR"
|
pushd "$PKGDIR"
|
||||||
rm -rf *.egg-info
|
rm -rf *.egg-info
|
||||||
python setup.py sdist --dist-dir "$BUILDDIR/tmp/localpip" --quiet
|
$PYTHON_COMMAND setup.py sdist --dist-dir "$BUILDDIR/tmp/localpip" --quiet
|
||||||
if [[ -r requirements.txt ]]; then
|
if [[ -r requirements.txt ]]; then
|
||||||
cp requirements.txt $BUILDDIR/tmp/${PKG}-requirements.txt
|
cp requirements.txt $BUILDDIR/tmp/${PKG}-requirements.txt
|
||||||
fi
|
fi
|
||||||
|
@ -185,7 +191,7 @@ fi
|
||||||
if [ -n "$PYTHON_EXTRA_SOURCES_DIR_LIST" ]; then
|
if [ -n "$PYTHON_EXTRA_SOURCES_DIR_LIST" ]; then
|
||||||
IFS="," read -ra PKGDIRS <<< "$PYTHON_EXTRA_SOURCES_DIR_LIST"
|
IFS="," read -ra PKGDIRS <<< "$PYTHON_EXTRA_SOURCES_DIR_LIST"
|
||||||
for PKGDIR in "${PKGDIRS[@]}"; do
|
for PKGDIR in "${PKGDIRS[@]}"; do
|
||||||
PKG=$(cd "$PKGDIR" ; python setup.py --name)
|
PKG=$(cd "$PKGDIR" ; $PYTHON_COMMAND setup.py --name)
|
||||||
if [[ -r $BUILDDIR/tmp/${PKG}-requirements.txt ]]; then
|
if [[ -r $BUILDDIR/tmp/${PKG}-requirements.txt ]]; then
|
||||||
$CHROOT_CMD ${PIP_COMMAND} wheel -c /tmp/upper-constraints.txt --wheel-dir /tmp/wheels -r /tmp/${PKG}-requirements.txt
|
$CHROOT_CMD ${PIP_COMMAND} wheel -c /tmp/upper-constraints.txt --wheel-dir /tmp/wheels -r /tmp/${PKG}-requirements.txt
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue