]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Added initial devstack plugin
authorIhar Hrachyshka <ihrachys@redhat.com>
Tue, 18 Aug 2015 14:57:44 +0000 (16:57 +0200)
committerMiguel Angel Ajo <mangelajo@redhat.com>
Thu, 20 Aug 2015 16:27:56 +0000 (18:27 +0200)
For now it only supports q-qos service that is used to configure QoS service
plugin. It also adds ability to enable l2 agent extensions.

To check that it works, I am enabling QoS tests back for API job.

Partially-Implements: blueprint quantum-qos-api
Change-Id: I19e4fe0cf5ecc55397628017631c3ff6718ce36f

devstack/lib/l2_agent [new file with mode: 0644]
devstack/lib/ml2 [new file with mode: 0644]
devstack/lib/qos [new file with mode: 0644]
devstack/plugin.sh [new file with mode: 0644]
devstack/settings [new file with mode: 0644]
neutron/tests/contrib/gate_hook.sh

diff --git a/devstack/lib/l2_agent b/devstack/lib/l2_agent
new file mode 100644 (file)
index 0000000..b70efb1
--- /dev/null
@@ -0,0 +1,13 @@
+function plugin_agent_add_l2_agent_extension {
+    local l2_agent_extension=$1
+    if [[ -z "$L2_AGENT_EXTENSIONS" ]]; then
+        L2_AGENT_EXTENSIONS=$l2_agent_extension
+    elif [[ ! ,${L2_AGENT_EXTENSIONS}, =~ ,${l2_agent_extension}, ]]; then
+        L2_AGENT_EXTENSIONS+=",$l2_agent_extension"
+    fi
+}
+
+
+function configure_l2_agent {
+    iniset /$Q_PLUGIN_CONF_FILE agent extensions "$L2_AGENT_EXTENSIONS"
+}
diff --git a/devstack/lib/ml2 b/devstack/lib/ml2
new file mode 100644 (file)
index 0000000..2275c11
--- /dev/null
@@ -0,0 +1,13 @@
+function enable_ml2_extension_driver {
+    local extension_driver=$1
+    if [[ -z "$Q_ML2_PLUGIN_EXT_DRIVERS" ]]; then
+        Q_ML2_PLUGIN_EXT_DRIVERS=$extension_driver
+    elif [[ ! ,${Q_ML2_PLUGIN_EXT_DRIVERS}, =~ ,${extension_driver}, ]]; then
+        Q_ML2_PLUGIN_EXT_DRIVERS+=",$extension_driver"
+    fi
+}
+
+
+function configure_qos_ml2 {
+    enable_ml2_extension_driver "qos"
+}
diff --git a/devstack/lib/qos b/devstack/lib/qos
new file mode 100644 (file)
index 0000000..e9270c0
--- /dev/null
@@ -0,0 +1,20 @@
+function configure_qos_service_plugin {
+    _neutron_service_plugin_class_add "qos"
+}
+
+
+function configure_qos_core_plugin {
+    configure_qos_$Q_PLUGIN
+}
+
+
+function configure_qos_l2_agent {
+    plugin_agent_add_l2_agent_extension "qos"
+}
+
+
+function configure_qos {
+    configure_qos_service_plugin
+    configure_qos_core_plugin
+    configure_qos_l2_agent
+}
diff --git a/devstack/plugin.sh b/devstack/plugin.sh
new file mode 100644 (file)
index 0000000..5b24549
--- /dev/null
@@ -0,0 +1,18 @@
+LIBDIR=$DEST/neutron/devstack/lib
+
+source $LIBDIR/l2_agent
+source $LIBDIR/ml2
+source $LIBDIR/qos
+
+
+if [[ "$1" == "stack" && "$2" == "install" ]]; then
+    if is_service_enabled q-qos; then
+        configure_qos
+    fi
+fi
+
+if [[ "$1" == "stack" && "$2" == "post-config" ]]; then
+    if is_service_enabled q-agt; then
+        configure_l2_agent
+    fi
+fi
diff --git a/devstack/settings b/devstack/settings
new file mode 100644 (file)
index 0000000..976317c
--- /dev/null
@@ -0,0 +1,3 @@
+L2_AGENT_EXTENSIONS=${L2_AGENT_EXTENSIONS:-}
+
+enable_service q-qos
index 57dbc4a6319b2246a42ed46c139111dfa3eb89b0..99d0ccf2f9d93d5334f9b5b87460528ba9af373d 100644 (file)
@@ -39,9 +39,8 @@ EOF
 
     export DEVSTACK_LOCAL_CONFIG+="
 enable_plugin neutron-vpnaas git://git.openstack.org/openstack/neutron-vpnaas
+enable_plugin neutron git://git.openstack.org/openstack/neutron
 "
 
-    export DEVSTACK_LOCAL_CONFIG+="DISABLE_NETWORK_API_EXTENSIONS=qos
-"
     $BASE/new/devstack-gate/devstack-vm-gate.sh
 fi