Skip to content

Commit 5f4b6de

Browse files
author
Gary Kotton
committed
Quantum common configuration support.
This ensures that devstack will work with the Quantum versions and ini files prior to, and after, the above mentioned changes. Change-Id: I18da8febf808c4752330ad1699a079c1d0a544fa
1 parent c634ccd commit 5f4b6de

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

stack.sh

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,27 +1084,40 @@ fi
10841084

10851085
# Quantum service (for controller node)
10861086
if is_service_enabled q-svc; then
1087-
Q_PLUGIN_INI_FILE=/etc/quantum/plugins.ini
1088-
Q_CONF_FILE=/etc/quantum/quantum.conf
10891087
# must remove this file from existing location, otherwise Quantum will prefer it
10901088
if [[ -e $QUANTUM_DIR/etc/plugins.ini ]]; then
1089+
# Support prior to common config
1090+
Q_PLUGIN_INI_FILE=/etc/quantum/plugins.ini
10911091
sudo mv $QUANTUM_DIR/etc/plugins.ini $Q_PLUGIN_INI_FILE
10921092
fi
1093+
Q_CONF_FILE=/etc/quantum/quantum.conf
1094+
Q_API_PASTE_FILE=/etc/quantum/api-paste.ini
10931095

10941096
if [[ -e $QUANTUM_DIR/etc/quantum.conf ]]; then
10951097
sudo mv $QUANTUM_DIR/etc/quantum.conf $Q_CONF_FILE
10961098
fi
10971099

1100+
if [[ -e $QUANTUM_DIR/etc/api-paste.ini ]]; then
1101+
sudo mv $QUANTUM_DIR/etc/api-paste.ini $Q_API_PASTE_FILE
1102+
fi
1103+
10981104
if is_service_enabled mysql; then
10991105
mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -e "DROP DATABASE IF EXISTS $Q_DB_NAME;"
11001106
mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -e "CREATE DATABASE IF NOT EXISTS $Q_DB_NAME CHARACTER SET utf8;"
11011107
else
11021108
echo "mysql must be enabled in order to use the $Q_PLUGIN Quantum plugin."
11031109
exit 1
11041110
fi
1105-
sudo sed -i -e "s/^provider =.*$/provider = $Q_PLUGIN_CLASS/g" $Q_PLUGIN_INI_FILE
11061111

1107-
screen_it q-svc "cd $QUANTUM_DIR && python $QUANTUM_DIR/bin/quantum-server $Q_CONF_FILE"
1112+
# Update either configuration file with plugin or old plugin file
1113+
# file checked below exists only in common config version
1114+
if [[ -e $QUANTUM_DIR/quantum/tests/etc/quantum.conf.test ]]; then
1115+
sudo sed -i -e "s/^core_plugin =.*$/core_plugin = $Q_PLUGIN_CLASS/g" $Q_CONF_FILE
1116+
else
1117+
sudo sed -i -e "s/^provider =.*$/provider = $Q_PLUGIN_CLASS/g" $Q_PLUGIN_INI_FILE
1118+
fi
1119+
1120+
screen_it q-svc "cd $QUANTUM_DIR && python $QUANTUM_DIR/bin/quantum-server --config-file $Q_CONF_FILE"
11081121
fi
11091122

11101123
# Quantum agent (for compute nodes)

0 commit comments

Comments
 (0)