def __init__(self, remote, schema, probe_interval=(), **kwargs): if probe_interval == (): # None is a valid value to pass probe_interval = ovn_conf.get_ovn_ovsdb_probe_interval() super(Ml2OvnIdlBase, self).__init__(remote, schema, probe_interval=probe_interval, **kwargs)
def start(self): connection_string = config.cfg.CONF.ovs.ovsdb_connection helper = idlutils.get_schema_helper(connection_string, 'Open_vSwitch') tables = ('Open_vSwitch', 'Bridge', 'Port', 'Interface') for table in tables: helper.register_table(table) ovs_idl = idl.Idl(connection_string, helper, probe_interval=config.get_ovn_ovsdb_probe_interval()) conn = connection.Connection( ovs_idl, timeout=config.cfg.CONF.ovs.ovsdb_connection_timeout) return idl_ovs.OvsdbIdl(conn)
def test_ovsdb_probe_interval(self): klasses = { ovsdb_monitor.BaseOvnIdl: ('OVN_Northbound', {}), ovsdb_monitor.OvnNbIdl: ('OVN_Northbound', {'driver': self.mech_driver}), ovsdb_monitor.OvnSbIdl: ('OVN_Southbound', {'driver': self.mech_driver})} idls = [kls.from_server(self.connections[schema], schema, **kwargs) for kls, (schema, kwargs) in klasses.items()] interval = ovn_conf.get_ovn_ovsdb_probe_interval() for idl in idls: self.assertEqual(interval, idl._session.reconnect.probe_interval)
def __init__(self, connection): super(OvsdbSbOvnIdl, self).__init__(connection) # TODO(twilson) This direct access of the idl should be removed in # favor of a backend-agnostic method self.idl._session.reconnect.set_probe_interval( cfg.get_ovn_ovsdb_probe_interval())
def __init__(self, connection): super(OvsdbNbOvnIdl, self).__init__(connection) self.idl._session.reconnect.set_probe_interval( cfg.get_ovn_ovsdb_probe_interval())