From 71fd2f6b7f99b1766d75bd5d271c6fc0eeccd113 Mon Sep 17 00:00:00 2001 From: Antony Messerli Date: Wed, 1 Nov 2017 17:44:06 -0500 Subject: [PATCH] Prevent deploying old code once leaped Previously the operator could choose to leap from old code once the code to leap to had been deployed. This would cause things to break as it would attempt to run the older version code on top of the newly deployed leaped code. This identifies those conditions, alerts the operator and calls the resume_incompete_leap instead of asking the operator to input the release to upgrade from again. Change-Id: I928bf7e6db88d46617af800692e9b76a6bcc1ba8 --- leap-upgrades/lib/functions.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/leap-upgrades/lib/functions.sh b/leap-upgrades/lib/functions.sh index 0b886b56..d2317e96 100644 --- a/leap-upgrades/lib/functions.sh +++ b/leap-upgrades/lib/functions.sh @@ -313,6 +313,12 @@ function pre_flight { set_upgrade_vars if [[ -f "${CONFIG_DIR}/upgrade-leap/redeploy-started.complete" && ! -f "${CONFIG_DIR}/upgrade-leap/osa-leap.complete" ]]; then + warning "Redeploy of ${CODE_UPGRADE_FROM} started but did not complete..." + resume_incomplete_leap + elif [[ -f "/opt/leap42/openstack-ansible-upgrade-hostupgrade.leap" ]] ; then + warning "Current code deployed is ${CODE_UPGRADE_FROM}" + warning "and it appears the leap process was interrupted after" + warning "starting the deployment of ${CODE_UPGRADE_FROM}." resume_incomplete_leap elif [ "${VALIDATE_UPGRADE_INPUT}" == "TRUE" ]; then validate_upgrade_input