Fix the OVS version check to work with upstream master versions of OVS.
This patch adds two functions to check version strings in the toplevel
functions file. The openvswitch_agent then uses these to compare versions
when checking for tunneling support. The tunneling version check now
also takes into account upstream master versions of Open vSwitch, which
the previous version check always failed on.
Fixes bug #1190734
Change-Id: I0102fb57f8ce5529169025efa21a0996ad68bef1
diff --git a/lib/quantum_plugins/openvswitch_agent b/lib/quantum_plugins/openvswitch_agent
index ee761ed..7e83428 100644
--- a/lib/quantum_plugins/openvswitch_agent
+++ b/lib/quantum_plugins/openvswitch_agent
@@ -43,8 +43,8 @@
if [[ "$OVS_ENABLE_TUNNELING" = "True" ]]; then
# Verify tunnels are supported
# REVISIT - also check kernel module support for GRE and patch ports
- OVS_VERSION=`ovs-vsctl --version | head -n 1 | awk '{print $4;}'`
- if [ $OVS_VERSION \< "1.4" ] && ! is_service_enabled q-svc ; then
+ OVS_VERSION=`ovs-vsctl --version | head -n 1 | grep -E -o "[0-9]+\.[0-9]+"`
+ 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