Clone the correct branch of nova for testing

The tox_install.sh script was always cloning the master branch of nova,
even when running from stable or unmaintained branches.

Change-Id: I8c13c461b48ee88321b02669772786f13b570438
This commit is contained in:
Pierre Riteau 2024-11-14 17:25:42 +01:00
parent d29eca6d8b
commit ce10d26726

View File

@ -14,13 +14,22 @@
# pip install {opts} {packages}
ZUUL_CLONER=/usr/zuul-env/bin/zuul-cloner
BRANCH_NAME=${NOVA_BRANCH:-master}
nova_installed=$(echo "import nova" | python 2>/dev/null ; echo $?)
NOVA_DIR=$HOME/nova
set -e
set -x
# Use .gitreview as the key to determine the appropriate branch to clone for
# tests. Inspired by OSA code.
PARENT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [ -f "${PARENT}/../.gitreview" ]; then
BRANCH_NAME=$(awk -F'=' '/defaultbranch/ {print $2}' "${PARENT}/../.gitreview")
if [[ "${BRANCH_NAME}" == "" ]]; then
BRANCH_NAME="master"
fi
fi
install_cmd="pip install -c$1"
shift