Browse code

Merge "Fixes Quantum rootwrap configuration"

Jenkins authored on 2012/09/25 05:32:23
Showing 1 changed files
... ...
@@ -357,6 +357,7 @@ Q_ADMIN_USERNAME=${Q_ADMIN_USERNAME:-quantum}
357 357
 Q_AUTH_STRATEGY=${Q_AUTH_STRATEGY:-keystone}
358 358
 # Use namespace or not
359 359
 Q_USE_NAMESPACE=${Q_USE_NAMESPACE:-True}
360
+Q_USE_ROOTWRAP=${Q_USE_ROOTWRAP=:-True}
360 361
 # Meta data IP
361 362
 Q_META_DATA_IP=${Q_META_DATA_IP:-}
362 363
 
... ...
@@ -1233,6 +1234,11 @@ if is_service_enabled quantum; then
1233 1233
     Q_CONF_FILE=/etc/quantum/quantum.conf
1234 1234
     cp $QUANTUM_DIR/etc/quantum.conf $Q_CONF_FILE
1235 1235
     Q_RR_CONF_FILE=/etc/quantum/rootwrap.conf
1236
+    if [[ "$Q_USE_ROOTWRAP" == "False" ]]; then
1237
+        Q_RR_COMMAND="sudo"
1238
+    else
1239
+        Q_RR_COMMAND="sudo $QUANTUM_DIR/bin/quantum-rootwrap $Q_RR_CONF_FILE"
1240
+    fi
1236 1241
     cp -p $QUANTUM_DIR/etc/rootwrap.conf $Q_RR_CONF_FILE
1237 1242
 
1238 1243
     # Copy over the config and filter bits
... ...
@@ -1345,8 +1351,6 @@ if is_service_enabled q-agt; then
1345 1345
         if [[ "$OVS_BRIDGE_MAPPINGS" != "" ]]; then
1346 1346
             iniset /$Q_PLUGIN_CONF_FILE OVS bridge_mappings $OVS_BRIDGE_MAPPINGS
1347 1347
         fi
1348
-        # Update config w/rootwrap
1349
-        iniset /$Q_PLUGIN_CONF_FILE OVS root_helper #Q_RR_CONF_FILE
1350 1348
         AGENT_BINARY="$QUANTUM_DIR/bin/quantum-openvswitch-agent"
1351 1349
     elif [[ "$Q_PLUGIN" = "linuxbridge" ]]; then
1352 1350
         # Setup physical network interface mappings.  Override
... ...
@@ -1358,10 +1362,10 @@ if is_service_enabled q-agt; then
1358 1358
         if [[ "$LB_INTERFACE_MAPPINGS" != "" ]]; then
1359 1359
             iniset /$Q_PLUGIN_CONF_FILE LINUX_BRIDGE physical_interface_mappings $LB_INTERFACE_MAPPINGS
1360 1360
         fi
1361
-        # Update config w/rootwrap
1362
-        iniset /$Q_PLUGIN_CONF_FILE LINUX_BRIDGE root_helper #Q_RR_CONF_FILE
1363 1361
         AGENT_BINARY="$QUANTUM_DIR/bin/quantum-linuxbridge-agent"
1364 1362
     fi
1363
+    # Update config w/rootwrap
1364
+    iniset /$Q_PLUGIN_CONF_FILE AGENT root_helper "$Q_RR_COMMAND"
1365 1365
 fi
1366 1366
 
1367 1367
 # Quantum DHCP
... ...
@@ -1381,7 +1385,7 @@ if is_service_enabled q-dhcp; then
1381 1381
     quantum_setup_keystone $Q_DHCP_CONF_FILE DEFAULT set_auth_url
1382 1382
 
1383 1383
     # Update config w/rootwrap
1384
-    iniset /$Q_DHCP_CONF_FILE DEFAULT root_helper #Q_RR_CONF_FILE
1384
+    iniset $Q_DHCP_CONF_FILE DEFAULT root_helper "$Q_RR_COMMAND"
1385 1385
 
1386 1386
     if [[ "$Q_PLUGIN" = "openvswitch" ]]; then
1387 1387
         iniset $Q_DHCP_CONF_FILE DEFAULT interface_driver quantum.agent.linux.interface.OVSInterfaceDriver
... ...
@@ -1406,6 +1410,8 @@ if is_service_enabled q-l3; then
1406 1406
     iniset $Q_L3_CONF_FILE DEFAULT metadata_ip $Q_META_DATA_IP
1407 1407
     iniset $Q_L3_CONF_FILE DEFAULT use_namespaces $Q_USE_NAMESPACE
1408 1408
 
1409
+    iniset $Q_L3_CONF_FILE DEFAULT root_helper "$Q_RR_COMMAND"
1410
+
1409 1411
     quantum_setup_keystone $Q_L3_CONF_FILE DEFAULT set_auth_url
1410 1412
     if [[ "$Q_PLUGIN" == "openvswitch" ]]; then
1411 1413
         iniset $Q_L3_CONF_FILE DEFAULT interface_driver quantum.agent.linux.interface.OVSInterfaceDriver