Allow passing extra parameters to keystone-manage in extend_start

This allows deployers to pass arbitrary parameters to the kesytone-manage
commands. Which can be useful to pass  the keystone log dir and file as an
empty environment variable, which, in turn, will allow us to make the db
sync command to log to stdout instead of the file.

Change-Id: Id9e8c641a6b00725d2f5c9623b05854a1b4e2af2
This commit is contained in:
Juan Antonio Osorio Robles 2017-10-31 07:58:35 +02:00
parent 568f131ab6
commit defa2808e7
1 changed files with 5 additions and 4 deletions

View File

@ -39,14 +39,15 @@ if [[ $(stat -c %a ${KEYSTONE_LOG_DIR}) != "755" ]]; then
chmod 755 ${KEYSTONE_LOG_DIR}
fi
EXTRA_KEYSTONE_MANAGE_ARGS=${EXTRA_KEYSTONE_MANAGE_ARGS-}
# Upgrade 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
# TODO(duonghq): check doctor result here
# TODO: find reason why doctor failed in gate
# sudo -H -u keystone keystone-manage doctor
sudo -H -u keystone keystone-manage db_sync --expand
sudo -H -u keystone keystone-manage db_sync --migrate
sudo -H -u keystone keystone-manage ${EXTRA_KEYSTONE_MANAGE_ARGS} db_sync --expand
sudo -H -u keystone keystone-manage ${EXTRA_KEYSTONE_MANAGE_ARGS} db_sync --migrate
exit 0
fi
@ -54,14 +55,14 @@ fi
# This catches all cases of the KOLLA_FINISH_UPGRADE variable being set,
# including empty.
if [[ "${!KOLLA_FINISH_UPGRADE[@]}" ]]; then
sudo -H -u keystone keystone-manage db_sync --contract
sudo -H -u keystone keystone-manage ${EXTRA_KEYSTONE_MANAGE_ARGS} db_sync --contract
exit 0
fi
# 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
sudo -H -u keystone keystone-manage db_sync
sudo -H -u keystone keystone-manage ${EXTRA_KEYSTONE_MANAGE_ARGS} db_sync
exit 0
fi