From 28eb9bb704e315eec8333e3f0dd80d8d3f0b29df Mon Sep 17 00:00:00 2001 From: Jinghan Sun Date: Mon, 22 Jan 2018 08:38:08 +0000 Subject: [PATCH] Fix bug in cyborg/devstack script (1) Define undefined local variables. (2) Correct script commands that create and migrates database Change-Id: I2c140bedf5e89c88ae1de72511e5068e35fd2fad Closes-bug: #1744630 --- devstack/lib/cyborg | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/devstack/lib/cyborg b/devstack/lib/cyborg index bfe1cde9..80eb931a 100644 --- a/devstack/lib/cyborg +++ b/devstack/lib/cyborg @@ -39,7 +39,11 @@ CYBORG_CONF_DIR=${CYBORG_CONF_DIR:-/etc/cyborg} CYBORG_CONF_FILE=$CYBORG_CONF_DIR/cyborg.conf CYBORG_ROOTWRAP_CONF=$CYBORG_CONF_DIR/rootwrap.conf CYBORG_POLICY_JSON=$CYBORG_CONF_DIR/policy.json - +if [[ -d ${CYBORG_DIR}/bin ]]; then + CYBORG_BIN_DIR=${CYBORG_DIR}/bin +else + CYBORG_BIN_DIR=$(get_python_exec_prefix) +fi # install_cyborg() - Install the things! function install_cyborg { @@ -178,8 +182,11 @@ function create_cyborg_cache_dir { # init_cyborg() - Initialize databases, etc. function init_cyborg { + # (re)create Cyborg database + recreate_database cyborg utf8 + # Migrate cyborg database - $CYBORG_BIN_DIR/cyborg-dbsync --config-file=$CYBORG_CONF_FILE + $CYBORG_BIN_DIR/cyborg-dbsync --config-file ${CYBORG_CONF_FILE} upgrade create_cyborg_cache_dir }