Browse code

Modification for Ubuntu 13.10 and minor fixes in Neutron NEC plugin

Modifications for Ubuntu 13.10:
* Add .conf suffix to apache2 config files. In Ubuntu 13.10,
files in sites-available should have ".conf" suffix.
Otherwise it is not recognized by a2ensite.
* libglib2.0-dev is added to lib/files/apt/trema. Trema is
an OpenFlow controler framework used by Neutron NEC plugin
Ubuntu package dependency seems to be changed.

Minor cleanups are also done in OVS configuration:
* Set datapath_id before connecting to the OpenFlow controller
to ensure datapath_id changes after connected.
Previously datapath_id is changed after connecting to the controller.
* Drop "0x" prefix from datapath_id passed to OVS.
OVS ignores datapath_id with 0x prefix.
* Fix a bug that SKIP_OVS_BRIDGE_SETUP skips all confiugration of
the plugin agent. It should skip only OVS setup.

Change-Id: Ifac3def8decda577b5740c82fe8d24e8520c7777

Akihiro MOTOKI authored on 2013/10/10 00:40:38
Showing 3 changed files
... ...
@@ -6,6 +6,7 @@ rubygems1.8
6 6
 ruby1.8-dev
7 7
 libpcap-dev
8 8
 libsqlite3-dev
9
+libglib2.0-dev
9 10
 
10 11
 # Sliceable Switch
11 12
 sqlite3
... ...
@@ -55,21 +55,26 @@ function neutron_plugin_configure_l3_agent() {
55 55
     _neutron_ovs_base_configure_l3_agent
56 56
 }
57 57
 
58
-function neutron_plugin_configure_plugin_agent() {
58
+function _quantum_plugin_setup_bridge() {
59 59
     if [[ "$SKIP_OVS_BRIDGE_SETUP" = "True" ]]; then
60 60
         return
61 61
     fi
62 62
     # Set up integration bridge
63 63
     _neutron_ovs_base_setup_bridge $OVS_BRIDGE
64
-    sudo ovs-vsctl --no-wait set-controller $OVS_BRIDGE tcp:$OFC_OFP_HOST:$OFC_OFP_PORT
65 64
     # Generate datapath ID from HOST_IP
66
-    local dpid=$(printf "0x%07d%03d%03d%03d\n" ${HOST_IP//./ })
65
+    local dpid=$(printf "%07d%03d%03d%03d\n" ${HOST_IP//./ })
67 66
     sudo ovs-vsctl --no-wait set Bridge $OVS_BRIDGE other-config:datapath-id=$dpid
68 67
     sudo ovs-vsctl --no-wait set-fail-mode $OVS_BRIDGE secure
68
+    sudo ovs-vsctl --no-wait set-controller $OVS_BRIDGE tcp:$OFC_OFP_HOST:$OFC_OFP_PORT
69 69
     if [ -n "$OVS_INTERFACE" ]; then
70 70
         sudo ovs-vsctl --no-wait -- --may-exist add-port $OVS_BRIDGE $OVS_INTERFACE
71 71
     fi
72 72
     _neutron_setup_ovs_tunnels $OVS_BRIDGE
73
+}
74
+
75
+function neutron_plugin_configure_plugin_agent() {
76
+    _quantum_plugin_setup_bridge
77
+
73 78
     AGENT_BINARY="$NEUTRON_BIN_DIR/neutron-nec-agent"
74 79
 
75 80
     _neutron_ovs_base_configure_firewall_driver
... ...
@@ -28,7 +28,7 @@ TREMA_TMP_DIR=$TREMA_DATA_DIR/trema
28 28
 TREMA_LOG_LEVEL=${TREMA_LOG_LEVEL:-info}
29 29
 
30 30
 TREMA_SS_CONFIG=$TREMA_SS_ETC_DIR/sliceable.conf
31
-TREMA_SS_APACHE_CONFIG=/etc/apache2/sites-available/sliceable_switch
31
+TREMA_SS_APACHE_CONFIG=/etc/apache2/sites-available/sliceable_switch.conf
32 32
 
33 33
 # configure_trema - Set config files, create data dirs, etc
34 34
 function configure_trema() {