Merge "Do not install N+1 release unless upgrade in progress"

This commit is contained in:
Zuul 2022-03-01 15:10:03 +00:00 committed by Gerrit Code Review
commit 5635352596
1 changed files with 42 additions and 40 deletions

View File

@ -34,21 +34,22 @@ echo "Done" >/dev/console
shopt -s nullglob
# Check whether a second release is installed
. /etc/build.info
CURRENT_REL_DIR=rel-${SW_VERSION}
OTHER_REL_DIR=
for REL_DIR in /var/www/pages/feed/*; do
if [ "$(curl -sf http://pxecontroller:6385/v1/upgrade/$(hostname)/upgrade_in_progress 2>/dev/null)" = "true" ]; then
# Check whether a second release is installed
. /etc/build.info
CURRENT_REL_DIR=rel-${SW_VERSION}
OTHER_REL_DIR=
for REL_DIR in /var/www/pages/feed/*; do
if [[ ! $REL_DIR =~ "${SW_VERSION}" ]]; then
OTHER_REL_DIR=`basename $REL_DIR`
OTHER_REL_VERSION=${OTHER_REL_DIR:4}
break
fi
done
done
# If second release is installed, find the latest version of the installer
# RPM and install the pxeboot files we require to boot hosts with that release.
if [ ! -z "$OTHER_REL_DIR" ]; then
# If second release is installed, find the latest version of the installer
# RPM and install the pxeboot files we require to boot hosts with that release.
if [ ! -z "$OTHER_REL_DIR" ]; then
PATCH_RPM=`find /var/www/pages/updates/${OTHER_REL_DIR}/Packages -name 'pxe-network-installer*' | sort -V | tail -1`
BASE_RPM=`find /var/www/pages/feed/${OTHER_REL_DIR}/Packages -name 'pxe-network-installer*' | sort -V | tail -1`
@ -75,6 +76,7 @@ if [ ! -z "$OTHER_REL_DIR" ]; then
|| report_post_failure_with_msg "Failed to copy pxe-network-installer pxelinux.cfg files"
rm -rf $TMP_RPM
fi
fi
%end