Exemple #1
0
 def __init__(self, conf):
     self.conf = conf
     vlog.use_python_logger(max_level=config.get_ovn_ovsdb_log_level())
     self._process_monitor = external_process.ProcessMonitor(
         config=self.conf, resource_type='metadata')
     self._sb_idl = None
     self._post_fork_event = threading.Event()
Exemple #2
0
 def _test_vlog_max_level_helper(self, max_level, patched_levels,
                                 unpatched_levels):
     vlog.reset_logger()
     vlog.use_python_logger(max_level=max_level)
     for lvl in patched_levels:
         self.assertTrue(vlog.is_patched(lvl))
     for lvl in unpatched_levels:
         self.assertFalse(vlog.is_patched(lvl))
Exemple #3
0
 def test_vlog_patch_all_but_debug(self):
     vlog.reset_logger()
     removed_level = vlog.DEBUG
     levels = set(vlog.ALL_LEVELS) - set([removed_level])
     vlog.use_python_logger(levels)
     for lvl in levels:
         self.assertTrue(vlog.is_patched(lvl))
     self.assertFalse(vlog.is_patched(removed_level))
def get_ovn_idls(driver, trigger):
    @tenacity.retry(wait=tenacity.wait_exponential(max=180), reraise=True)
    def get_ovn_idl_retry(cls):
        LOG.info('Getting %(cls)s for %(trigger)s with retry', {
            'cls': cls.__name__,
            'trigger': trigger.im_class.__name__
        })
        return cls(get_connection(cls, trigger, driver))

    vlog.use_python_logger(max_level=cfg.get_ovn_ovsdb_log_level())
    return tuple(get_ovn_idl_retry(c) for c in (OvsdbNbOvnIdl, OvsdbSbOvnIdl))
Exemple #5
0
def get_ovn_idls(driver, trigger, binding_events=False):
    @tenacity.retry(
        wait=tenacity.wait_exponential(
            max=cfg.get_ovn_ovsdb_retry_max_interval()),
        reraise=True)
    def get_ovn_idl_retry(cls):
        trigger_class = utils.get_method_class(trigger)
        LOG.info('Getting %(cls)s for %(trigger)s with retry',
                 {'cls': cls.__name__, 'trigger': trigger_class.__name__})
        return cls(get_connection(cls, trigger, driver, binding_events))

    vlog.use_python_logger(max_level=cfg.get_ovn_ovsdb_log_level())
    return tuple(get_ovn_idl_retry(c) for c in (OvsdbNbOvnIdl, OvsdbSbOvnIdl))
Exemple #6
0
 def __init__(self, conf):
     self.conf = conf
     vlog.use_python_logger(max_level=config.get_ovn_ovsdb_log_level())
     self._process_monitor = external_process.ProcessMonitor(
         config=self.conf, resource_type='metadata')
Exemple #7
0
 def __init__(self, connection):
     max_level = None if cfg.CONF.OVS.ovsdb_debug else vlog.INFO
     vlog.use_python_logger(max_level=max_level)
     super(NeutronOvsdbIdl, self).__init__(connection)
 def __init__(self, connection, idl_monitor):
     max_level = None if cfg.CONF.OVS.ovsdb_debug else vlog.INFO
     vlog.use_python_logger(max_level=max_level)
     self.idl_monitor = idl_monitor
     super().__init__(connection)
Exemple #9
0
 def __init__(self, connection):
     max_level = None if cfg.CONF.OVS.ovsdb_debug else vlog.INFO
     vlog.use_python_logger(max_level=max_level)
     super(NeutronOvsdbIdl, self).__init__(connection)
Exemple #10
0
 def __init__(self, connection):
     vlog.use_python_logger()
     super(NeutronOvsdbIdl, self).__init__(connection)
Exemple #11
0
 def __init__(self, connection):
     vlog.use_python_logger()
     super(NeutronOvsdbIdl, self).__init__(connection)
 def __init__(self, conn):
     vlog.use_python_logger()
     super(OvsdbIdl, self).__init__(conn)
Exemple #13
0
 def _setUp(self):
     vlog.use_python_logger(*self.args, **self.kwargs)
     self.addCleanup(vlog.reset_logger)