Merge "Don't ever give up trying to connect to OVN DBs"
This commit is contained in:
commit
ab24ff018f
@ -41,6 +41,19 @@ from neutron.services.portforwarding import constants as pf_const
|
|||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
# Override wait_for_change to not use a timeout so we always try to reconnect
|
||||||
|
def wait_for_change(idl_, timeout, seqno=None):
|
||||||
|
if seqno is None:
|
||||||
|
seqno = idl_.change_seqno
|
||||||
|
while idl_.change_seqno == seqno and not idl_.run():
|
||||||
|
poller = idlutils.poller.Poller()
|
||||||
|
idl_.wait(poller)
|
||||||
|
poller.block()
|
||||||
|
|
||||||
|
|
||||||
|
idlutils.wait_for_change = wait_for_change
|
||||||
|
|
||||||
|
|
||||||
class OvnNbTransaction(idl_trans.Transaction):
|
class OvnNbTransaction(idl_trans.Transaction):
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
import copy
|
import copy
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
|
from ovsdbapp.backend.ovs_idl import connection
|
||||||
from ovsdbapp import constants as const
|
from ovsdbapp import constants as const
|
||||||
from ovsdbapp import event as ovsdb_event
|
from ovsdbapp import event as ovsdb_event
|
||||||
from ovsdbapp.tests.functional import base
|
from ovsdbapp.tests.functional import base
|
||||||
@ -259,3 +260,13 @@ class TestNbApi(BaseOvnIdlTest):
|
|||||||
lb_match = f(exp_fip_id)
|
lb_match = f(exp_fip_id)
|
||||||
self.assertIn((lb_match['name'], lb_match['external_ids']),
|
self.assertIn((lb_match['name'], lb_match['external_ids']),
|
||||||
exp_values)
|
exp_values)
|
||||||
|
|
||||||
|
|
||||||
|
class TestIgnoreConnectionTimeout(BaseOvnIdlTest):
|
||||||
|
@classmethod
|
||||||
|
def create_connection(cls, schema):
|
||||||
|
idl = connection.OvsdbIdl.from_server(cls.schema_map[schema], schema)
|
||||||
|
return connection.Connection(idl, 0)
|
||||||
|
|
||||||
|
def test_setUp_will_fail_if_this_is_broken(self):
|
||||||
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user