diff options
author | Julia Kreger <juliaashleykreger@gmail.com> | 2021-08-04 17:07:52 -0700 |
---|---|---|
committer | Julia Kreger <juliaashleykreger@gmail.com> | 2021-08-07 22:16:09 +0000 |
commit | 7b097f016baeddcaca920f02daed3c4fdfe599db (patch) | |
tree | 79adc95dbf1acc55443cc248ce11d3c78951271e /devstack | |
parent | b39989f50e0181625e45f81063f4893f3e3fc63d (diff) | |
download | ironic-7b097f016baeddcaca920f02daed3c4fdfe599db.tar.gz |
Fix upgrade logic to allow for bundled changes
The upgrade path logic was built to force a developer pattern to break
things such as new tables and features across multiple patches, and
the status check *can* explicitly fail if we don't explicitly go
hint to it that we've added table. Yes, we have a hard coded list...
Anyway, a better pattern is allow the db sync process to do the
appropriate needful. Run the status check, if it fails, fallback
and update the schema.
Also handles the explicit failure error and tries to return a human
friendly error message for when the table is not present.
In the end this allows us to merge schema changes such as additional
tables with their underlying objects and properly handle things as
long as the schema update works as expected. This allows us to
leverage an operational model of performing upgrades.
Change-Id: Id5f2a8068bc064e1ed1e376524850e4739f79ef2
Diffstat (limited to 'devstack')
-rwxr-xr-x | devstack/upgrade/upgrade.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/devstack/upgrade/upgrade.sh b/devstack/upgrade/upgrade.sh index 8c6096da8..7801ccd26 100755 --- a/devstack/upgrade/upgrade.sh +++ b/devstack/upgrade/upgrade.sh @@ -81,7 +81,12 @@ if [ $ret_val -gt 1 ] ; then # Warnings are permissible and returned as status code 1, errors are # returned as greater than 1 which means there is a major upgrade # stopping issue which needs to be addressed. - die $LINENO "Ironic DB Status check failed, returned: $ret_val" + echo "WARNING: Status check failed, we're going to attempt to apply the schema update and then re-evaluate." + $IRONIC_BIN_DIR/ironic-dbsync --config-file=$IRONIC_CONF_FILE upgrade + $IRONIC_BIN_DIR/ironic-status upgrade check && ret_val=$? || ret_val=$? + if [ $ret_val -gt 1 ] ; then + die $LINENO "Ironic DB Status check failed, returned: $ret_val" + fi fi $IRONIC_BIN_DIR/ironic-dbsync --config-file=$IRONIC_CONF_FILE |