[OVN] TrivialFix: use_new_ovn_repository must check major version

use_new_ovn_repository function is used to determine whether
OVN source is co-located with OVS repo or if it is post-split [1].
In a nutshell, OVS versions 'branch-2.13' and newer are on a
separate repo [2].

The existing implementation only looks at minor portion of version
to determine if OVN is post-split, which is not future proof.

Since 'M' comes after 'B', the logic sees 'master' as newer
than 'branch-2.12', which is actually the wanted behavior.

[1]: f3e24610ea
[2]: https://github.com/ovn-org/ovn

Change-Id: I7abeb05ea53b6eeced77ca9490a9bb7c5c07c64c
Signed-off-by: Flavio Fernandes <flaviof@redhat.com>
Co-authored-by: Terry Wilson <twilson@redhat.com>
This commit is contained in:
Flavio Fernandes 2020-01-14 05:50:22 -05:00
parent ab24a11f13
commit 7d5cd3f47d

View File

@ -144,12 +144,7 @@ function is_kernel_module_loaded {
function use_new_ovn_repository {
# IF OVN_BRANCH is "master" or branch-2.13 (or higher), use the new
# OVN repository
if [ "$OVN_BRANCH" == "master" ] || \
[ $(echo $OVN_BRANCH | sed -e 's/^branch-\([0-9]*\)\.//') -ge 13 ]; then
return 0
else
return 1
fi
return $(! printf "%s\n%s" $OVN_BRANCH branch-2.12 | sort -C -V)
}
# NOTE(rtheis): Function copied from DevStack _neutron_ovs_base_setup_bridge