Browse code

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."

Jenkins authored on 2012/06/20 02:54:51
Showing 1 changed files
... ...
@@ -1087,17 +1087,23 @@ fi
1087 1087
 
1088 1088
 # Quantum service (for controller node)
1089 1089
 if is_service_enabled q-svc; then
1090
-    Q_PLUGIN_INI_FILE=/etc/quantum/plugins.ini
1091
-    Q_CONF_FILE=/etc/quantum/quantum.conf
1092 1090
     # must remove this file from existing location, otherwise Quantum will prefer it
1093 1091
     if [[ -e $QUANTUM_DIR/etc/plugins.ini ]]; then
1092
+        # Support prior to common config
1093
+        Q_PLUGIN_INI_FILE=/etc/quantum/plugins.ini
1094 1094
         sudo mv $QUANTUM_DIR/etc/plugins.ini $Q_PLUGIN_INI_FILE
1095 1095
     fi
1096
+    Q_CONF_FILE=/etc/quantum/quantum.conf
1097
+    Q_API_PASTE_FILE=/etc/quantum/api-paste.ini
1096 1098
 
1097 1099
     if [[ -e $QUANTUM_DIR/etc/quantum.conf ]]; then
1098 1100
       sudo mv $QUANTUM_DIR/etc/quantum.conf $Q_CONF_FILE
1099 1101
     fi
1100 1102
 
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
+
1101 1107
     if is_service_enabled mysql; then
1102 1108
             mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -e "DROP DATABASE IF EXISTS $Q_DB_NAME;"
1103 1109
             mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -e "CREATE DATABASE IF NOT EXISTS $Q_DB_NAME CHARACTER SET utf8;"
... ...
@@ -1105,9 +1111,16 @@ if is_service_enabled q-svc; then
1105 1105
             echo "mysql must be enabled in order to use the $Q_PLUGIN Quantum plugin."
1106 1106
             exit 1
1107 1107
     fi
1108
-    sudo sed -i -e "s/^provider =.*$/provider = $Q_PLUGIN_CLASS/g" $Q_PLUGIN_INI_FILE
1109 1108
 
1110
-    screen_it q-svc "cd $QUANTUM_DIR && python $QUANTUM_DIR/bin/quantum-server $Q_CONF_FILE"
1109
+    # Update either configuration file with plugin or old plugin file
1110
+    # file checked below exists only in common config version
1111
+    if [[ -e $QUANTUM_DIR/quantum/tests/etc/quantum.conf.test ]]; then
1112
+        sudo sed -i -e "s/^core_plugin =.*$/core_plugin = $Q_PLUGIN_CLASS/g" $Q_CONF_FILE
1113
+    else
1114
+        sudo sed -i -e "s/^provider =.*$/provider = $Q_PLUGIN_CLASS/g" $Q_PLUGIN_INI_FILE
1115
+    fi
1116
+
1117
+    screen_it q-svc "cd $QUANTUM_DIR && python $QUANTUM_DIR/bin/quantum-server --config-file $Q_CONF_FILE"
1111 1118
 fi
1112 1119
 
1113 1120
 # Quantum agent (for compute nodes)