Data migration failure during upgrade

CONFIG_SYSTEM_MODE may not be present in pre-upgrade installs.
All older installs are DX so assume the value is duplex if missing.

Change-Id: Ic9f9c7b8551862225f6a563009ed930a88536af8
Story: 2002886
Task: 22847
Signed-off-by: Jack Ding <jack.ding@windriver.com>
This commit is contained in:
David Sullivan 2018-03-09 14:19:35 -05:00 committed by Jack Ding
parent 81a98656bf
commit 94bc1b03fd
2 changed files with 10 additions and 2 deletions

View File

@ -1,2 +1,2 @@
SRC_DIR="controllerconfig"
TIS_PATCH_VER=142
TIS_PATCH_VER=143

View File

@ -814,7 +814,15 @@ def migrate_databases(from_release, shared_services, hiera_db_records,
# To avoid a deadlock during keystone contract we will use offline
# migration for simplex upgrades. Other upgrades will have to use
# another method to resolve the deadlock
system_mode = packstack_config.get('general', 'CONFIG_SYSTEM_MODE')
try:
system_mode = packstack_config.get('general', 'CONFIG_SYSTEM_MODE')
except ConfigParser.NoOptionError:
# We may not have the system mode if the system was upgraded from
# R2 or R3. Those systems can only be duplex so we will use that
# value
LOG.info("Missing value CONFIG_SYSTEM_MODE. Using duplex.")
system_mode = sysinv_constants.SYSTEM_MODE_DUPLEX
if system_mode != sysinv_constants.SYSTEM_MODE_SIMPLEX:
migrate_commands += [
# Migrate keystone