def __init__(self, core_plugin, ovn_api, mode, ovn_driver): super(OvnNbSynchronizer, self).__init__(core_plugin, ovn_api, ovn_driver) self.mode = mode self.l3_plugin = directory.get_plugin(plugin_constants.L3) self._ovn_client = ovn_client.OVNClient(ovn_api, self.l3_plugin._sb_ovn)
def _ovn_client(self): if self._ovn_client_inst is None: if not (self._nb_ovn and self._sb_ovn): # Wait until the post_fork_initialize method has finished and # IDLs have been correctly setup. self._post_fork_event.wait() self._ovn_client_inst = ovn_client.OVNClient( self._nb_ovn, self._sb_ovn) return self._ovn_client_inst
def post_fork_initialize(self, resource, event, trigger, **kwargs): # NOTE(rtheis): This will initialize all workers (API, RPC, # plugin service and OVN) with OVN IDL connections. self._nb_ovn, self._sb_ovn = impl_idl_ovn.get_ovn_idls(self, trigger) self._ovn_client = ovn_client.OVNClient(self._nb_ovn, self._sb_ovn) if trigger.im_class == ovsdb_monitor.OvnWorker: # Call the synchronization task if its ovn worker # This sync neutron DB to OVN-NB DB only in inconsistent states self.nb_synchronizer = ovn_db_sync.OvnNbSynchronizer( self._plugin, self._nb_ovn, config.get_ovn_neutron_sync_mode(), self) self.nb_synchronizer.sync() # This sync neutron DB to OVN-SB DB only in inconsistent states self.sb_synchronizer = ovn_db_sync.OvnSbSynchronizer( self._plugin, self._sb_ovn, self) self.sb_synchronizer.sync()
def _ovn_client(self): if self._ovn_client_inst is None: self._ovn_client_inst = ovn_client.OVNClient( self._ovn, self._sb_ovn) return self._ovn_client_inst
def ovn_client(self): if not self._ovn_client: self._ovn_client = ovn_client.OVNClient(self._nb_ovn, self._sb_ovn) return self._ovn_client