From defa2808e709fc50ebdeb99802028731963eb376 Mon Sep 17 00:00:00 2001 From: Juan Antonio Osorio Robles Date: Tue, 31 Oct 2017 07:58:35 +0200 Subject: 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 --- docker/keystone/keystone/extend_start.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docker/keystone/keystone/extend_start.sh b/docker/keystone/keystone/extend_start.sh index cd8a75635..8802dd9d5 100644 --- a/docker/keystone/keystone/extend_start.sh +++ b/docker/keystone/keystone/extend_start.sh @@ -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 -- cgit v1.2.3