Skip to content

Commit ff63834

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "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."
2 parents cb7aaf3 + 5f4b6de commit ff63834

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
@@ -1087,27 +1087,40 @@ fi
10871087

10881088
# Quantum service (for controller node)
10891089
if is_service_enabled q-svc; then
1090-
Q_PLUGIN_INI_FILE=/etc/quantum/plugins.ini
1091-
Q_CONF_FILE=/etc/quantum/quantum.conf
10921090
# must remove this file from existing location, otherwise Quantum will prefer it
10931091
if [[ -e $QUANTUM_DIR/etc/plugins.ini ]]; then
1092+
# Support prior to common config
1093+
Q_PLUGIN_INI_FILE=/etc/quantum/plugins.ini
10941094
sudo mv $QUANTUM_DIR/etc/plugins.ini $Q_PLUGIN_INI_FILE
10951095
fi
1096+
Q_CONF_FILE=/etc/quantum/quantum.conf
1097+
Q_API_PASTE_FILE=/etc/quantum/api-paste.ini
10961098

10971099
if [[ -e $QUANTUM_DIR/etc/quantum.conf ]]; then
10981100
sudo mv $QUANTUM_DIR/etc/quantum.conf $Q_CONF_FILE
10991101
fi
11001102

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

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

11131126
# Quantum agent (for compute nodes)

0 commit comments

Comments
 (0)