Merge "Run nova online data migration before updating packages"

This commit is contained in:
Zuul 2017-12-13 13:01:18 +00:00 committed by Gerrit Code Review
commit 9034cf5a9b
1 changed files with 6 additions and 6 deletions

View File

@ -1852,12 +1852,6 @@ def install(instack_root, upgrade=False):
instack_env = _generate_environment(instack_root)
_generate_init_data(instack_env)
if upgrade:
# We didn't complete the M->N upgrades correctly with a
# `nova-manage db online_data_migrations` command before. This
# could cause the post-upgrade db sync to fail. Better be safe
# than sorry and run it before package upgrade.
_run_command(['sudo', '-E', '/usr/bin/nova-manage', 'db',
'online_data_migrations'])
# Even if we backport https://review.openstack.org/#/c/457478/
# into stable branches of puppet-ironic, we still need a way
# to handle existing deployments.
@ -1902,6 +1896,12 @@ def pre_upgrade():
_run_live_command(args, name='systemctl stop')
LOG.info('Services stopped successfully')
# Ensure nova data migrations are complete before upgrading packages
LOG.info('Running Nova online data migration')
_run_command(['sudo', '-E', '/usr/bin/nova-manage', 'db',
'online_data_migrations'])
LOG.info('Nova online data migration completed')
args = ['sudo', 'yum', 'install', '-y', 'ansible-pacemaker']
LOG.info('Installing Ansible Pacemaker module')
_run_live_command(args, name='install ansible')