From a9963e90d93afc282a64823fd572ef46d88eaa47 Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Sun, 23 Apr 2023 13:13:52 +0200 Subject: [PATCH] ``_get_ovn_version`` returns a 3 element tuple The output of this method should be compared to a 3 element tuple. This patch changes the minimum versions of the supported features to have 3 elements too. This are the version changes and their justifications: * OVN_NB_DB_SCHEMA_GATEWAY_CHASSIS = '5.7.0' Version reported in LP#2008077 * OVN_NB_DB_SCHEMA_PORT_GROUP = '5.11.0' Version reported in LP#1946023 * OVN_NB_DB_SCHEMA_STATELESS_NAT = '5.17.0' Version reported in LP#1949494 * OVN_SB_DB_SCHEMA_VIRTUAL_PORT = '2.5.0' Version reported in LP#1949496 * OVN_LOCALNET_LEARN_FDB = '22.09.0' Version reported in LP#1946023. In fact, the version supporting this feature is older. Closes-Bug: #2017878 Change-Id: Idc19b30e2453b4d68473b488dba226dc48be9efe --- neutron/cmd/sanity/checks.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/neutron/cmd/sanity/checks.py b/neutron/cmd/sanity/checks.py index 2a49363eb65..329e99463a9 100644 --- a/neutron/cmd/sanity/checks.py +++ b/neutron/cmd/sanity/checks.py @@ -49,11 +49,11 @@ DNSMASQ_VERSION_HOST_ADDR6_LIST = '2.81' DIRECT_PORT_QOS_MIN_OVS_VERSION = '2.11' MINIMUM_DIBBLER_VERSION = '1.0.1' CONNTRACK_GRE_MODULE = 'nf_conntrack_proto_gre' -OVN_NB_DB_SCHEMA_GATEWAY_CHASSIS = '5.7' -OVN_NB_DB_SCHEMA_PORT_GROUP = '5.11' -OVN_NB_DB_SCHEMA_STATELESS_NAT = '5.17' -OVN_SB_DB_SCHEMA_VIRTUAL_PORT = '2.5' -OVN_LOCALNET_LEARN_FDB = '22.09' +OVN_NB_DB_SCHEMA_GATEWAY_CHASSIS = '5.7.0' +OVN_NB_DB_SCHEMA_PORT_GROUP = '5.11.0' +OVN_NB_DB_SCHEMA_STATELESS_NAT = '5.17.0' +OVN_SB_DB_SCHEMA_VIRTUAL_PORT = '2.5.0' +OVN_LOCALNET_LEARN_FDB = '22.09.0' class OVNCheckType(enum.Enum): @@ -64,6 +64,14 @@ class OVNCheckType(enum.Enum): def _get_ovn_version(check_type): + """Retrieves the OVN nbctl, sbctl, NS schema or SB schema version + + :param check_type: ``OVNCheckType`` enum element. This method can return + the nbctl version, the sbctl version, the NB schema + version or the SB schema version. + :return: (tuple) 3 element tuple: (major, minor, revision). (0, 0, 0) by + default. + """ if check_type in (OVNCheckType.nb_version, OVNCheckType.nb_db_schema): cmd = ['ovn-nbctl', '--version'] elif check_type in (OVNCheckType.nb_version, OVNCheckType.nb_db_schema): @@ -79,9 +87,9 @@ def _get_ovn_version(check_type): else: matched_line = re.search(r"DB Schema.*", out) - matched_version = re.search(r"(\d+\.\d+)", matched_line.group(0)) + matched_version = re.search(r"(\d+\.\d+\.\d+)", matched_line.group(0)) return versionutils.convert_version_to_tuple(matched_version.group(1) if - matched_version else '0.0') + matched_version else '0.0.0') def ovs_vxlan_supported(from_ip='192.0.2.1', to_ip='192.0.2.2'):