Remove core OVN backward compatible code
The current Ubuntu image uses OVN 22.04 which is now almost 2 years old. The schema contains both Logical_DP_Group and Chassis_Private so it's safe to remove the code that assumes the tables might not be available. Change-Id: I3cb4219b173cce13354a024ce445865e5724d654
This commit is contained in:
parent
d5171f8a67
commit
4cd15d1158
@ -38,7 +38,8 @@ LOG = logging.getLogger(__name__)
|
|||||||
# LOG.setLevel(logging.DEBUG)
|
# LOG.setLevel(logging.DEBUG)
|
||||||
# logging.basicConfig(level=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):
|
class OVNBGPDriver(driver_api.AgentDriverBase):
|
||||||
@ -98,30 +99,12 @@ class OVNBGPDriver(driver_api.AgentDriverBase):
|
|||||||
events += (event_class(self),)
|
events += (event_class(self),)
|
||||||
|
|
||||||
self._post_fork_event.clear()
|
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
|
self.sb_idl = ovn.OvnSbIdl(
|
||||||
# we can remove this fallback mode.
|
self.ovn_remote,
|
||||||
try:
|
chassis=self.chassis,
|
||||||
try:
|
tables=OVN_TABLES,
|
||||||
self.sb_idl = ovn.OvnSbIdl(
|
events=events).start()
|
||||||
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()
|
|
||||||
|
|
||||||
# Now IDL connections can be safely used
|
# Now IDL connections can be safely used
|
||||||
self._post_fork_event.set()
|
self._post_fork_event.set()
|
||||||
|
@ -36,7 +36,7 @@ LOG = logging.getLogger(__name__)
|
|||||||
# LOG.setLevel(logging.DEBUG)
|
# LOG.setLevel(logging.DEBUG)
|
||||||
# logging.basicConfig(level=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(
|
EVPN_INFO = collections.namedtuple(
|
||||||
'EVPNInfo', ['vrf_name', 'lo_name', 'bridge_name', 'vxlan_name',
|
'EVPNInfo', ['vrf_name', 'lo_name', 'bridge_name', 'vxlan_name',
|
||||||
'veth_vrf', 'veth_ovs', 'vlan_name'])
|
'veth_vrf', 'veth_ovs', 'vlan_name'])
|
||||||
@ -78,22 +78,12 @@ class OVNEVPNDriver(driver_api.AgentDriverBase):
|
|||||||
events += (event_class(self),)
|
events += (event_class(self),)
|
||||||
|
|
||||||
self._post_fork_event.clear()
|
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
|
self.sb_idl = ovn.OvnSbIdl(
|
||||||
# we can remove this fallback mode.
|
self.ovn_remote,
|
||||||
try:
|
chassis=self.chassis,
|
||||||
self.sb_idl = ovn.OvnSbIdl(
|
tables=OVN_TABLES,
|
||||||
self.ovn_remote,
|
events=events).start()
|
||||||
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()
|
|
||||||
|
|
||||||
# Now IDL connections can be safely used
|
# Now IDL connections can be safely used
|
||||||
self._post_fork_event.set()
|
self._post_fork_event.set()
|
||||||
|
@ -36,7 +36,7 @@ from ovn_bgp_agent.utils import linux_net
|
|||||||
CONF = cfg.CONF
|
CONF = cfg.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
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)
|
@dataclasses.dataclass(frozen=True, eq=True)
|
||||||
@ -93,23 +93,13 @@ class OVNBGPStretchedL2Driver(driver_api.AgentDriverBase):
|
|||||||
events += (event_class(self),)
|
events += (event_class(self),)
|
||||||
|
|
||||||
self._post_fork_event.clear()
|
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
|
self.sb_idl = ovn.OvnSbIdl(
|
||||||
# we can remove this fallback mode.
|
self.ovn_remote,
|
||||||
try:
|
chassis=self.chassis,
|
||||||
self.sb_idl = ovn.OvnSbIdl(
|
tables=OVN_TABLES,
|
||||||
self.ovn_remote,
|
events=events,
|
||||||
chassis=self.chassis,
|
).start()
|
||||||
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()
|
|
||||||
|
|
||||||
# Now IDL connections can be safely used
|
# Now IDL connections can be safely used
|
||||||
self._post_fork_event.set()
|
self._post_fork_event.set()
|
||||||
|
Loading…
Reference in New Issue
Block a user