From 56f519f472adf235856853bf12bfeac0d16a8b3f Mon Sep 17 00:00:00 2001 From: Maciej Jozefczyk Date: Mon, 15 Jun 2020 12:19:43 +0000 Subject: [PATCH] [OVN] Load segments plugin in case not loaded in maintanance task While the segments plugin is not loaded in neutron config, it should be loaded anyways in OVN maintanance task, to operate on the first default segment of each network. Change-Id: Ideffacc2f478c95eeec881c82d1d5bae46ecdc74 Closes-Bug: 1883193 --- .../plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_db_sync.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_db_sync.py b/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_db_sync.py index 99f02c134b7..e71eb36c1f1 100644 --- a/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_db_sync.py +++ b/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_db_sync.py @@ -29,6 +29,7 @@ from neutron.common.ovn import acl as acl_utils from neutron.common.ovn import constants as ovn_const from neutron.common.ovn import utils from neutron.conf.plugins.ml2.drivers.ovn import ovn_conf +from neutron import manager from neutron.plugins.ml2.drivers.ovn.mech_driver.ovsdb import ovn_client from neutron.services.segments import db as segments_db @@ -72,6 +73,10 @@ class OvnNbSynchronizer(OvnDbSynchronizer): self.l3_plugin = directory.get_plugin(plugin_constants.L3) self._ovn_client = ovn_client.OVNClient(ovn_api, sb_ovn) self.segments_plugin = directory.get_plugin('segments') + if not self.segments_plugin: + self.segments_plugin = ( + manager.NeutronManager.load_class_for_provider( + 'neutron.service_plugins', 'segments')()) def stop(self): if utils.is_ovn_l3(self.l3_plugin):