Use lowercase section names in Neutron (aka Quantum)

Fixes bug 1194064

The DEFAULT section remains the same.

In addition to this the sql_connection has been changed to
connection - this is for OSLO DB support.

Change-Id: I56175146941a9cae966033b557e44097e29a5d43
diff --git a/lib/quantum_plugins/bigswitch_floodlight b/lib/quantum_plugins/bigswitch_floodlight
index edee0eb..1199745 100644
--- a/lib/quantum_plugins/bigswitch_floodlight
+++ b/lib/quantum_plugins/bigswitch_floodlight
@@ -42,8 +42,8 @@
 }
 
 function quantum_plugin_configure_service() {
-    iniset /$Q_PLUGIN_CONF_FILE RESTPROXY servers $BS_FL_CONTROLLERS_PORT
-    iniset /$Q_PLUGIN_CONF_FILE RESTPROXY servertimeout $BS_FL_CONTROLLER_TIMEOUT
+    iniset /$Q_PLUGIN_CONF_FILE restproxy servers $BS_FL_CONTROLLERS_PORT
+    iniset /$Q_PLUGIN_CONF_FILE restproxy servertimeout $BS_FL_CONTROLLER_TIMEOUT
 }
 
 function quantum_plugin_setup_interface_driver() {
diff --git a/lib/quantum_plugins/linuxbridge b/lib/quantum_plugins/linuxbridge
index dffa32b..989b930 100644
--- a/lib/quantum_plugins/linuxbridge
+++ b/lib/quantum_plugins/linuxbridge
@@ -14,7 +14,7 @@
 
 function quantum_plugin_configure_service() {
     if [[ "$ENABLE_TENANT_VLANS" = "True" ]]; then
-        iniset /$Q_PLUGIN_CONF_FILE VLANS tenant_network_type vlan
+        iniset /$Q_PLUGIN_CONF_FILE vlans tenant_network_type vlan
     else
         echo "WARNING - The linuxbridge plugin is using local tenant networks, with no connectivity between hosts."
     fi
@@ -28,12 +28,12 @@
         fi
     fi
     if [[ "$LB_VLAN_RANGES" != "" ]]; then
-        iniset /$Q_PLUGIN_CONF_FILE VLANS network_vlan_ranges $LB_VLAN_RANGES
+        iniset /$Q_PLUGIN_CONF_FILE vlans network_vlan_ranges $LB_VLAN_RANGES
     fi
     if [[ "$Q_USE_SECGROUP" == "True" ]]; then
-        iniset /$Q_PLUGIN_CONF_FILE SECURITYGROUP firewall_driver quantum.agent.linux.iptables_firewall.IptablesFirewallDriver
+        iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver quantum.agent.linux.iptables_firewall.IptablesFirewallDriver
     else
-        iniset /$Q_PLUGIN_CONF_FILE SECURITYGROUP firewall_driver quantum.agent.firewall.NoopFirewallDriver
+        iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver quantum.agent.firewall.NoopFirewallDriver
     fi
 
     # Define extra "LINUX_BRIDGE" configuration options when q-svc is configured by defining
@@ -41,7 +41,7 @@
     # For Example: ``Q_SRV_EXTRA_OPTS=(foo=true bar=2)``
     for I in "${Q_SRV_EXTRA_OPTS[@]}"; do
         # Replace the first '=' with ' ' for iniset syntax
-        iniset /$Q_PLUGIN_CONF_FILE LINUX_BRIDGE ${I/=/ }
+        iniset /$Q_PLUGIN_CONF_FILE linux_bridge ${I/=/ }
     done
 }
 
diff --git a/lib/quantum_plugins/linuxbridge_agent b/lib/quantum_plugins/linuxbridge_agent
index 7855cd0..b3ca8b1 100644
--- a/lib/quantum_plugins/linuxbridge_agent
+++ b/lib/quantum_plugins/linuxbridge_agent
@@ -39,12 +39,12 @@
         LB_INTERFACE_MAPPINGS=$PHYSICAL_NETWORK:$LB_PHYSICAL_INTERFACE
     fi
     if [[ "$LB_INTERFACE_MAPPINGS" != "" ]]; then
-        iniset /$Q_PLUGIN_CONF_FILE LINUX_BRIDGE physical_interface_mappings $LB_INTERFACE_MAPPINGS
+        iniset /$Q_PLUGIN_CONF_FILE linux_bridge physical_interface_mappings $LB_INTERFACE_MAPPINGS
     fi
     if [[ "$Q_USE_SECGROUP" == "True" ]]; then
-        iniset /$Q_PLUGIN_CONF_FILE SECURITYGROUP firewall_driver quantum.agent.linux.iptables_firewall.IptablesFirewallDriver
+        iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver quantum.agent.linux.iptables_firewall.IptablesFirewallDriver
     else
-        iniset /$Q_PLUGIN_CONF_FILE SECURITYGROUP firewall_driver quantum.agent.firewall.NoopFirewallDriver
+        iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver quantum.agent.firewall.NoopFirewallDriver
     fi
     AGENT_BINARY="$QUANTUM_DIR/bin/quantum-linuxbridge-agent"
     # Define extra "AGENT" configuration options when q-agt is configured by defining
@@ -52,14 +52,14 @@
     # For Example: ``Q_AGENT_EXTRA_AGENT_OPTS=(foo=true bar=2)``
     for I in "${Q_AGENT_EXTRA_AGENT_OPTS[@]}"; do
         # Replace the first '=' with ' ' for iniset syntax
-        iniset /$Q_PLUGIN_CONF_FILE AGENT ${I/=/ }
+        iniset /$Q_PLUGIN_CONF_FILE agent ${I/=/ }
     done
     # Define extra "LINUX_BRIDGE" configuration options when q-agt is configured by defining
     # the array ``Q_AGENT_EXTRA_SRV_OPTS``.
     # For Example: ``Q_AGENT_EXTRA_SRV_OPTS=(foo=true bar=2)``
     for I in "${Q_AGENT_EXTRA_SRV_OPTS[@]}"; do
         # Replace the first '=' with ' ' for iniset syntax
-        iniset /$Q_PLUGIN_CONF_FILE LINUX_BRIDGE ${I/=/ }
+        iniset /$Q_PLUGIN_CONF_FILE linux_bridge ${I/=/ }
     done
 }
 
diff --git a/lib/quantum_plugins/nec b/lib/quantum_plugins/nec
index 608e267..69bbe0e 100644
--- a/lib/quantum_plugins/nec
+++ b/lib/quantum_plugins/nec
@@ -77,11 +77,11 @@
 
 function quantum_plugin_configure_service() {
     iniset $QUANTUM_CONF DEFAULT api_extensions_path quantum/plugins/nec/extensions/
-    iniset /$Q_PLUGIN_CONF_FILE OFC host $OFC_API_HOST
-    iniset /$Q_PLUGIN_CONF_FILE OFC port $OFC_API_PORT
-    iniset /$Q_PLUGIN_CONF_FILE OFC driver $OFC_DRIVER
-    iniset /$Q_PLUGIN_CONF_FILE OFC api_retry_max OFC_RETRY_MAX
-    iniset /$Q_PLUGIN_CONF_FILE OFC api_retry_interval OFC_RETRY_INTERVAL
+    iniset /$Q_PLUGIN_CONF_FILE ofc host $OFC_API_HOST
+    iniset /$Q_PLUGIN_CONF_FILE ofc port $OFC_API_PORT
+    iniset /$Q_PLUGIN_CONF_FILE ofc driver $OFC_DRIVER
+    iniset /$Q_PLUGIN_CONF_FILE ofc api_retry_max OFC_RETRY_MAX
+    iniset /$Q_PLUGIN_CONF_FILE ofc api_retry_interval OFC_RETRY_INTERVAL
 
     _quantum_ovs_base_configure_firewall_driver
 }
diff --git a/lib/quantum_plugins/nicira b/lib/quantum_plugins/nicira
index c9c6d0e..d4b3e51 100644
--- a/lib/quantum_plugins/nicira
+++ b/lib/quantum_plugins/nicira
@@ -68,16 +68,16 @@
 
 function quantum_plugin_configure_service() {
     if [[ "$MAX_LP_PER_BRIDGED_LS" != "" ]]; then
-        iniset /$Q_PLUGIN_CONF_FILE NVP max_lp_per_bridged_ls $MAX_LP_PER_BRIDGED_LS
+        iniset /$Q_PLUGIN_CONF_FILE nvp max_lp_per_bridged_ls $MAX_LP_PER_BRIDGED_LS
     fi
     if [[ "$MAX_LP_PER_OVERLAY_LS" != "" ]]; then
-        iniset /$Q_PLUGIN_CONF_FILE NVP max_lp_per_overlay_ls $MAX_LP_PER_OVERLAY_LS
+        iniset /$Q_PLUGIN_CONF_FILE nvp max_lp_per_overlay_ls $MAX_LP_PER_OVERLAY_LS
     fi
     if [[ "$FAILOVER_TIME" != "" ]]; then
-        iniset /$Q_PLUGIN_CONF_FILE NVP failover_time $FAILOVER_TIME
+        iniset /$Q_PLUGIN_CONF_FILE nvp failover_time $FAILOVER_TIME
     fi
     if [[ "$CONCURRENT_CONNECTIONS" != "" ]]; then
-        iniset /$Q_PLUGIN_CONF_FILE NVP concurrent_connections $CONCURRENT_CONNECTIONS
+        iniset /$Q_PLUGIN_CONF_FILE nvp concurrent_connections $CONCURRENT_CONNECTIONS
     fi
 
     if [[ "$DEFAULT_TZ_UUID" != "" ]]; then
@@ -89,7 +89,7 @@
         iniset /$Q_PLUGIN_CONF_FILE DEFAULT default_l3_gw_service_uuid $DEFAULT_L3_GW_SVC_UUID
         Q_L3_ENABLED=True
         Q_L3_ROUTER_PER_TENANT=True
-        iniset /$Q_PLUGIN_CONF_FILE NVP enable_metadata_access_network True
+        iniset /$Q_PLUGIN_CONF_FILE nvp enable_metadata_access_network True
     fi
     if [[ "$DEFAULT_L2_GW_SVC_UUID" != "" ]]; then
         iniset /$Q_PLUGIN_CONF_FILE DEFAULT default_l2_gw_service_uuid $DEFAULT_L2_GW_SVC_UUID
diff --git a/lib/quantum_plugins/openvswitch b/lib/quantum_plugins/openvswitch
index e53db8a..4aac9f8 100644
--- a/lib/quantum_plugins/openvswitch
+++ b/lib/quantum_plugins/openvswitch
@@ -16,10 +16,10 @@
 
 function quantum_plugin_configure_service() {
     if [[ "$ENABLE_TENANT_TUNNELS" = "True" ]]; then
-        iniset /$Q_PLUGIN_CONF_FILE OVS tenant_network_type gre
-        iniset /$Q_PLUGIN_CONF_FILE OVS tunnel_id_ranges $TENANT_TUNNEL_RANGES
+        iniset /$Q_PLUGIN_CONF_FILE ovs tenant_network_type gre
+        iniset /$Q_PLUGIN_CONF_FILE ovs tunnel_id_ranges $TENANT_TUNNEL_RANGES
     elif [[ "$ENABLE_TENANT_VLANS" = "True" ]]; then
-        iniset /$Q_PLUGIN_CONF_FILE OVS tenant_network_type vlan
+        iniset /$Q_PLUGIN_CONF_FILE ovs tenant_network_type vlan
     else
         echo "WARNING - The openvswitch plugin is using local tenant networks, with no connectivity between hosts."
     fi
@@ -33,12 +33,12 @@
         fi
     fi
     if [[ "$OVS_VLAN_RANGES" != "" ]]; then
-        iniset /$Q_PLUGIN_CONF_FILE OVS network_vlan_ranges $OVS_VLAN_RANGES
+        iniset /$Q_PLUGIN_CONF_FILE ovs network_vlan_ranges $OVS_VLAN_RANGES
     fi
 
     # Enable tunnel networks if selected
     if [[ $OVS_ENABLE_TUNNELING = "True" ]]; then
-        iniset /$Q_PLUGIN_CONF_FILE OVS enable_tunneling True
+        iniset /$Q_PLUGIN_CONF_FILE ovs enable_tunneling True
     fi
 
     _quantum_ovs_base_configure_firewall_driver
@@ -48,7 +48,7 @@
     # For Example: ``Q_SRV_EXTRA_OPTS=(foo=true bar=2)``
     for I in "${Q_SRV_EXTRA_OPTS[@]}"; do
         # Replace the first '=' with ' ' for iniset syntax
-        iniset /$Q_PLUGIN_CONF_FILE OVS ${I/=/ }
+        iniset /$Q_PLUGIN_CONF_FILE ovs ${I/=/ }
     done
 }
 
diff --git a/lib/quantum_plugins/openvswitch_agent b/lib/quantum_plugins/openvswitch_agent
index 7e83428..608c3ea 100644
--- a/lib/quantum_plugins/openvswitch_agent
+++ b/lib/quantum_plugins/openvswitch_agent
@@ -47,8 +47,8 @@
         if [ `vercmp_numbers "$OVS_VERSION" "1.4"` -lt "0" ] && ! is_service_enabled q-svc ; then
             die $LINENO "You are running OVS version $OVS_VERSION. OVS 1.4+ is required for tunneling between multiple hosts."
         fi
-        iniset /$Q_PLUGIN_CONF_FILE OVS enable_tunneling True
-        iniset /$Q_PLUGIN_CONF_FILE OVS local_ip $HOST_IP
+        iniset /$Q_PLUGIN_CONF_FILE ovs enable_tunneling True
+        iniset /$Q_PLUGIN_CONF_FILE ovs local_ip $HOST_IP
     fi
 
     # Setup physical network bridge mappings.  Override
@@ -61,7 +61,7 @@
         sudo ovs-vsctl --no-wait -- --may-exist add-br $OVS_PHYSICAL_BRIDGE
     fi
     if [[ "$OVS_BRIDGE_MAPPINGS" != "" ]]; then
-        iniset /$Q_PLUGIN_CONF_FILE OVS bridge_mappings $OVS_BRIDGE_MAPPINGS
+        iniset /$Q_PLUGIN_CONF_FILE ovs bridge_mappings $OVS_BRIDGE_MAPPINGS
     fi
     AGENT_BINARY="$QUANTUM_DIR/bin/quantum-openvswitch-agent"
 
@@ -73,20 +73,20 @@
         Q_RR_DOM0_COMMAND="$QUANTUM_DIR/bin/quantum-rootwrap-xen-dom0 $Q_RR_CONF_FILE"
 
         # For now, duplicate the xen configuration already found in nova.conf
-        iniset $Q_RR_CONF_FILE XENAPI xenapi_connection_url "$XENAPI_CONNECTION_URL"
-        iniset $Q_RR_CONF_FILE XENAPI xenapi_connection_username "$XENAPI_USER"
-        iniset $Q_RR_CONF_FILE XENAPI xenapi_connection_password "$XENAPI_PASSWORD"
+        iniset $Q_RR_CONF_FILE xenapi xenapi_connection_url "$XENAPI_CONNECTION_URL"
+        iniset $Q_RR_CONF_FILE xenapi xenapi_connection_username "$XENAPI_USER"
+        iniset $Q_RR_CONF_FILE xenapi xenapi_connection_password "$XENAPI_PASSWORD"
 
         # Under XS/XCP, the ovs agent needs to target the dom0
         # integration bridge.  This is enabled by using a root wrapper
         # that executes commands on dom0 via a XenAPI plugin.
-        iniset /$Q_PLUGIN_CONF_FILE AGENT root_helper "$Q_RR_DOM0_COMMAND"
+        iniset /$Q_PLUGIN_CONF_FILE agent root_helper "$Q_RR_DOM0_COMMAND"
 
         # Set "physical" mapping
-        iniset /$Q_PLUGIN_CONF_FILE OVS bridge_mappings "physnet1:$FLAT_NETWORK_BRIDGE"
+        iniset /$Q_PLUGIN_CONF_FILE ovs bridge_mappings "physnet1:$FLAT_NETWORK_BRIDGE"
 
         # XEN_INTEGRATION_BRIDGE is the integration bridge in dom0
-        iniset /$Q_PLUGIN_CONF_FILE OVS integration_bridge $XEN_INTEGRATION_BRIDGE
+        iniset /$Q_PLUGIN_CONF_FILE ovs integration_bridge $XEN_INTEGRATION_BRIDGE
 
         # Set up domU's L2 agent:
 
@@ -96,25 +96,25 @@
         sudo ovs-vsctl add-port "br-$GUEST_INTERFACE_DEFAULT" $GUEST_INTERFACE_DEFAULT
 
         # Set bridge mappings to "physnet1:br-$GUEST_INTERFACE_DEFAULT"
-        iniset "/$Q_PLUGIN_CONF_FILE.domU" OVS bridge_mappings "physnet1:br-$GUEST_INTERFACE_DEFAULT"
+        iniset "/$Q_PLUGIN_CONF_FILE.domU" ovs bridge_mappings "physnet1:br-$GUEST_INTERFACE_DEFAULT"
         # Set integration bridge to domU's
-        iniset "/$Q_PLUGIN_CONF_FILE.domU" OVS integration_bridge $OVS_BRIDGE
+        iniset "/$Q_PLUGIN_CONF_FILE.domU" ovs integration_bridge $OVS_BRIDGE
         # Set root wrap
-        iniset "/$Q_PLUGIN_CONF_FILE.domU" AGENT root_helper "$Q_RR_COMMAND"
+        iniset "/$Q_PLUGIN_CONF_FILE.domU" agent root_helper "$Q_RR_COMMAND"
     fi
     # Define extra "AGENT" configuration options when q-agt is configured by defining
     # defining the array ``Q_AGENT_EXTRA_AGENT_OPTS``.
     # For Example: ``Q_AGENT_EXTRA_AGENT_OPTS=(foo=true bar=2)``
     for I in "${Q_AGENT_EXTRA_AGENT_OPTS[@]}"; do
         # Replace the first '=' with ' ' for iniset syntax
-        iniset /$Q_PLUGIN_CONF_FILE AGENT ${I/=/ }
+        iniset /$Q_PLUGIN_CONF_FILE agent ${I/=/ }
     done
     # Define extra "OVS" configuration options when q-agt is configured by defining
     # defining the array ``Q_AGENT_EXTRA_SRV_OPTS``.
     # For Example: ``Q_AGENT_EXTRA_SRV_OPTS=(foo=true bar=2)``
     for I in "${Q_AGENT_EXTRA_SRV_OPTS[@]}"; do
         # Replace the first '=' with ' ' for iniset syntax
-        iniset /$Q_PLUGIN_CONF_FILE OVS ${I/=/ }
+        iniset /$Q_PLUGIN_CONF_FILE ovs ${I/=/ }
     done
 }
 
diff --git a/lib/quantum_plugins/ovs_base b/lib/quantum_plugins/ovs_base
index a5e03ac..646ff4a 100644
--- a/lib/quantum_plugins/ovs_base
+++ b/lib/quantum_plugins/ovs_base
@@ -56,9 +56,9 @@
 
 function _quantum_ovs_base_configure_firewall_driver() {
     if [[ "$Q_USE_SECGROUP" == "True" ]]; then
-        iniset /$Q_PLUGIN_CONF_FILE SECURITYGROUP firewall_driver quantum.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
+        iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver quantum.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
     else
-        iniset /$Q_PLUGIN_CONF_FILE SECURITYGROUP firewall_driver quantum.agent.firewall.NoopFirewallDriver
+        iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver quantum.agent.firewall.NoopFirewallDriver
     fi
 }
 
diff --git a/lib/quantum_plugins/plumgrid b/lib/quantum_plugins/plumgrid
index 1456710..dde18c8 100644
--- a/lib/quantum_plugins/plumgrid
+++ b/lib/quantum_plugins/plumgrid
@@ -27,8 +27,8 @@
 function quantum_plugin_configure_service() {
     PLUMGRID_NOS_IP=${PLUMGRID_NOS_IP:-localhost}
     PLUMGRID_NOS_PORT=${PLUMGRID_NOS_PORT:-7766}
-    iniset /$Q_PLUGIN_CONF_FILE PLUMgridNOS nos_server $PLUMGRID_NOS_IP
-    iniset /$Q_PLUGIN_CONF_FILE PLUMgridNOS nos_server_port $PLUMGRID_NOS_PORT
+    iniset /$Q_PLUGIN_CONF_FILE plumgridnos nos_server $PLUMGRID_NOS_IP
+    iniset /$Q_PLUGIN_CONF_FILE plumgridnos nos_server_port $PLUMGRID_NOS_PORT
 }
 
 function quantum_plugin_configure_debug_command() {
diff --git a/lib/quantum_plugins/ryu b/lib/quantum_plugins/ryu
index dcdccb7..53c4f41 100644
--- a/lib/quantum_plugins/ryu
+++ b/lib/quantum_plugins/ryu
@@ -49,14 +49,14 @@
     if [ -n "$RYU_INTERNAL_INTERFACE" ]; then
         sudo ovs-vsctl --no-wait -- --may-exist add-port $OVS_BRIDGE $RYU_INTERNAL_INTERFACE
     fi
-    iniset /$Q_PLUGIN_CONF_FILE OVS integration_bridge $OVS_BRIDGE
+    iniset /$Q_PLUGIN_CONF_FILE ovs integration_bridge $OVS_BRIDGE
     AGENT_BINARY="$QUANTUM_DIR/quantum/plugins/ryu/agent/ryu_quantum_agent.py"
 
     _quantum_ovs_base_configure_firewall_driver
 }
 
 function quantum_plugin_configure_service() {
-    iniset /$Q_PLUGIN_CONF_FILE OVS openflow_rest_api $RYU_API_HOST:$RYU_API_PORT
+    iniset /$Q_PLUGIN_CONF_FILE ovs openflow_rest_api $RYU_API_HOST:$RYU_API_PORT
 
     _quantum_ovs_base_configure_firewall_driver
 }