Merge "Remove core OVN backward compatible code"

This commit is contained in:
Zuul 2024-01-12 15:15:47 +00:00 committed by Gerrit Code Review
commit 9852a8069f
3 changed files with 23 additions and 60 deletions

View File

@ -38,7 +38,8 @@ LOG = logging.getLogger(__name__)
# LOG.setLevel(logging.DEBUG)
# logging.basicConfig(level=logging.DEBUG)
OVN_TABLES = ["Port_Binding", "Chassis", "Datapath_Binding", "Load_Balancer"]
OVN_TABLES = ["Port_Binding", "Chassis", "Datapath_Binding", "Load_Balancer",
"Chassis_Private", "Logical_DP_Group"]
class OVNBGPDriver(driver_api.AgentDriverBase):
@ -98,30 +99,12 @@ class OVNBGPDriver(driver_api.AgentDriverBase):
events += (event_class(self),)
self._post_fork_event.clear()
# TODO(lucasagomes): The OVN package in the ubuntu LTS is old
# and does not support Chassis_Private. Once the package is updated
# we can remove this fallback mode.
try:
try:
self.sb_idl = ovn.OvnSbIdl(
self.ovn_remote,
chassis=self.chassis,
tables=OVN_TABLES + ["Chassis_Private",
"Logical_DP_Group"],
events=events).start()
except AssertionError:
self.sb_idl = ovn.OvnSbIdl(
self.ovn_remote,
chassis=self.chassis,
tables=OVN_TABLES + ["Chassis_Private"],
events=events).start()
except AssertionError:
events.remove("ChassisPrivateCreateEvent")
self.sb_idl = ovn.OvnSbIdl(
self.ovn_remote,
chassis=self.chassis,
tables=OVN_TABLES,
events=events).start()
self.sb_idl = ovn.OvnSbIdl(
self.ovn_remote,
chassis=self.chassis,
tables=OVN_TABLES,
events=events).start()
# Now IDL connections can be safely used
self._post_fork_event.set()

View File

@ -36,7 +36,7 @@ LOG = logging.getLogger(__name__)
# LOG.setLevel(logging.DEBUG)
# logging.basicConfig(level=logging.DEBUG)
OVN_TABLES = ["Port_Binding", "Chassis", "Datapath_Binding"]
OVN_TABLES = ["Port_Binding", "Chassis", "Datapath_Binding", "Chassis_Private"]
EVPN_INFO = collections.namedtuple(
'EVPNInfo', ['vrf_name', 'lo_name', 'bridge_name', 'vxlan_name',
'veth_vrf', 'veth_ovs', 'vlan_name'])
@ -78,22 +78,12 @@ class OVNEVPNDriver(driver_api.AgentDriverBase):
events += (event_class(self),)
self._post_fork_event.clear()
# TODO(lucasagomes): The OVN package in the ubuntu LTS is old
# and does not support Chassis_Private. Once the package is updated
# we can remove this fallback mode.
try:
self.sb_idl = ovn.OvnSbIdl(
self.ovn_remote,
chassis=self.chassis,
tables=OVN_TABLES + ["Chassis_Private"],
events=events).start()
except AssertionError:
events.remove("ChassisPrivateCreateEvent")
self.sb_idl = ovn.OvnSbIdl(
self.ovn_remote,
chassis=self.chassis,
tables=OVN_TABLES,
events=events).start()
self.sb_idl = ovn.OvnSbIdl(
self.ovn_remote,
chassis=self.chassis,
tables=OVN_TABLES,
events=events).start()
# Now IDL connections can be safely used
self._post_fork_event.set()

View File

@ -36,7 +36,7 @@ from ovn_bgp_agent.utils import linux_net
CONF = cfg.CONF
LOG = logging.getLogger(__name__)
OVN_TABLES = ["Port_Binding", "Chassis", "Datapath_Binding"]
OVN_TABLES = ["Port_Binding", "Chassis", "Datapath_Binding", "Chassis_Private"]
@dataclasses.dataclass(frozen=True, eq=True)
@ -93,23 +93,13 @@ class OVNBGPStretchedL2Driver(driver_api.AgentDriverBase):
events += (event_class(self),)
self._post_fork_event.clear()
# TODO(lucasagomes): The OVN package in the ubuntu LTS is old
# and does not support Chassis_Private. Once the package is updated
# we can remove this fallback mode.
try:
self.sb_idl = ovn.OvnSbIdl(
self.ovn_remote,
chassis=self.chassis,
tables=OVN_TABLES + ["Chassis_Private"],
events=events,
).start()
except AssertionError:
self.sb_idl = ovn.OvnSbIdl(
self.ovn_remote,
chassis=self.chassis,
tables=OVN_TABLES,
events=events,
).start()
self.sb_idl = ovn.OvnSbIdl(
self.ovn_remote,
chassis=self.chassis,
tables=OVN_TABLES,
events=events,
).start()
# Now IDL connections can be safely used
self._post_fork_event.set()