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
This commit is contained in:
Jinghan Sun 2018-01-22 08:38:08 +00:00
parent d421f978f0
commit 28eb9bb704
1 changed files with 9 additions and 2 deletions

View File

@ -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
}