Esempio n. 1
0
 def _start_ovn_northd(self):
     if not self.ovsdb_server_mgr:
         return
     ovn_nb_db = self.ovsdb_server_mgr.get_ovsdb_connection_path('nb')
     ovn_sb_db = self.ovsdb_server_mgr.get_ovsdb_connection_path('sb')
     self.ovn_northd_mgr = self.useFixture(
         process.OvnNorthd(self.temp_dir,
                           ovn_nb_db, ovn_sb_db,
                           protocol=self._ovsdb_protocol))
Esempio n. 2
0
File: base.py Progetto: thh/neutron
 def _start_ovn_northd(self):
     if not self.ovsdb_server_mgr:
         return
     ovn_nb_db = self.ovsdb_server_mgr.get_ovsdb_connection_path('nb')
     ovn_sb_db = self.ovsdb_server_mgr.get_ovsdb_connection_path('sb')
     LOG.debug("Starting OVN northd")
     self.ovn_northd_mgr = self.useFixture(
         process.OvnNorthd(self.temp_dir,
                           ovn_nb_db, ovn_sb_db,
                           protocol=self._ovsdb_protocol))
     LOG.debug("OVN northd started: %r", self.ovn_northd_mgr)
Esempio n. 3
0
    def _start_ovn_northd(self):
        if not self.ovsdb_server_mgr:
            return

        def wait_for_northd():
            try:
                self.nb_api.nb_global
            except StopIteration:
                LOG.debug("NB_Global is not ready yet")
                return False

            try:
                next(
                    iter(
                        self.sb_api.db_list_rows('SB_Global').execute(
                            check_error=True)))
            except StopIteration:
                LOG.debug("SB_Global is not ready yet")
                return False
            except KeyError:
                # Maintenance worker doesn't register SB_Global therefore
                # we don't need to wait for it
                LOG.debug("SB_Global is not registered in this IDL")

            return True

        timeout = 20
        ovn_nb_db = self.ovsdb_server_mgr.get_ovsdb_connection_path('nb')
        ovn_sb_db = self.ovsdb_server_mgr.get_ovsdb_connection_path('sb')
        LOG.debug("Starting OVN northd")
        self.ovn_northd_mgr = self.useFixture(
            process.OvnNorthd(self.temp_dir,
                              ovn_nb_db,
                              ovn_sb_db,
                              protocol=self._ovsdb_protocol))
        LOG.debug("OVN northd started: %r", self.ovn_northd_mgr)
        n_utils.wait_until_true(
            wait_for_northd,
            timeout,
            sleep=1,
            exception=Exception("ovn-northd didn't initialize OVN DBs in %d"
                                "seconds" % timeout))