From 7d5cd3f47dd23c9dae7047eda63c0ee2e04a4fdc Mon Sep 17 00:00:00 2001 From: Flavio Fernandes Date: Tue, 14 Jan 2020 05:50:22 -0500 Subject: [PATCH] [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]: https://github.com/openvswitch/ovs/commit/f3e24610ea18eb873dc860f1710432e9aacd27fd [2]: https://github.com/ovn-org/ovn Change-Id: I7abeb05ea53b6eeced77ca9490a9bb7c5c07c64c Signed-off-by: Flavio Fernandes Co-authored-by: Terry Wilson --- devstack/lib/ovn_agent | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/devstack/lib/ovn_agent b/devstack/lib/ovn_agent index 10d5dfb80da..85e16334080 100644 --- a/devstack/lib/ovn_agent +++ b/devstack/lib/ovn_agent @@ -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