Add pre-upgrade entrypoint

This will allow tripleoclient to update instack-undercloud, call the
new pre_upgrade hook which will contain any new steps needed for
the coming release, and then call the regular upgrade script to
apply all the new configuration.

bp undercloud-upgrade

Change-Id: If7c2f5f5a904d570b2f2fbe4eea3f8fd7162afb9
This commit is contained in:
Ben Nemec 2017-06-29 21:39:46 +00:00
parent f39efe35c3
commit bda75f1640
2 changed files with 17 additions and 0 deletions

View File

@ -1606,3 +1606,17 @@ def install(instack_root, upgrade=False):
{'undercloud_operation': undercloud_operation,
'password_path': PATHS.PASSWORD_PATH,
'stackrc_path': os.path.expanduser('~/stackrc')})
def pre_upgrade():
_configure_logging(DEFAULT_LOG_LEVEL, PATHS.LOG_FILE)
args = ['sudo', 'systemctl', 'stop', 'openstack-*', 'neutron-*',
'openvswitch', 'httpd']
LOG.info('Stopping OpenStack and related services')
_run_live_command(args, name='systemctl stop')
LOG.info('Services stopped successfully')
args = ['sudo', 'yum', 'update', '-y']
LOG.info('Updating full system')
_run_live_command(args, name='systemctl stop')
LOG.info('Update completed successfully')

View File

@ -0,0 +1,3 @@
#!/bin/bash
python -c "from instack_undercloud import undercloud; undercloud.pre_upgrade()"