Files
kolla/docker/neutron/neutron-server/extend_start.sh
Duong Ha-Quang da209cc181 Apply neutron database migration
Apply neutron database migration procedure:

http://docs.openstack.org/developer/neutron/devref/upgrade.html#server-upgrade

Change-Id: Id03e6cdd822bb8bd3d70ae1a1f70ccd9aba830ff
Implements: blueprint apply-service-upgrade-procedure
2017-01-26 01:31:27 +00:00

23 lines
800 B
Bash

#!/bin/bash
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head
exit 0
fi
# Migrate database and exit if KOLLA_UPGRADE variable is set. This catches all cases
# of the KOLLA_UPGRADE variable being set, including empty.
if [[ "${!KOLLA_UPGRADE[@]}" ]]; then
if [[ "${!NEUTRON_DB_EXPAND[@]}" ]]; then
echo "Expanding database"
neutron-db-manage upgrade --expand
fi
if [[ "${!NEUTRON_DB_CONTRACT[@]}" ]]; then
echo "Contracting database"
neutron-db-manage upgrade --contract
fi
exit 0
fi