Merge "[OVS] Exception message when retrieving bridge-id and is not present" into stable/queens
This commit is contained in:
commit
716e36c8b4
@ -160,8 +160,10 @@ class BaseOVS(object):
|
||||
def get_bridges(self):
|
||||
return self.ovsdb.list_br().execute(check_error=True)
|
||||
|
||||
def get_bridge_external_bridge_id(self, bridge):
|
||||
return self.ovsdb.br_get_external_id(bridge, 'bridge-id').execute()
|
||||
def get_bridge_external_bridge_id(self, bridge, check_error=False,
|
||||
log_errors=True):
|
||||
return self.ovsdb.br_get_external_id(bridge, 'bridge-id').execute(
|
||||
check_error=check_error, log_errors=log_errors)
|
||||
|
||||
def set_db_attribute(self, table_name, record, column, value,
|
||||
check_error=False, log_errors=True):
|
||||
|
@ -1017,7 +1017,8 @@ class OVSNeutronAgent(l2population_rpc.L2populationRpcCallBackTunnelMixin,
|
||||
# bridge-id's configured
|
||||
br_names = []
|
||||
for bridge in ovs_bridges:
|
||||
bridge_id = ovs.get_bridge_external_bridge_id(bridge)
|
||||
bridge_id = ovs.get_bridge_external_bridge_id(bridge,
|
||||
log_errors=False)
|
||||
if bridge_id != bridge:
|
||||
br_names.append(bridge)
|
||||
ovs_bridges.difference_update(br_names)
|
||||
|
@ -2328,7 +2328,7 @@ class AncillaryBridgesTest(object):
|
||||
def _test_ancillary_bridges(self, bridges, ancillary):
|
||||
device_ids = ancillary[:]
|
||||
|
||||
def pullup_side_effect(*args):
|
||||
def pullup_side_effect(*args, **kwargs):
|
||||
# Check that the device_id exists, if it does return it
|
||||
# if it does not return None
|
||||
try:
|
||||
|
@ -182,7 +182,8 @@ class TunnelTest(object):
|
||||
ovs_lib.BaseOVS,
|
||||
'get_bridge_external_bridge_id').start()
|
||||
self.get_bridge_external_bridge_id.side_effect = (
|
||||
lambda bridge: bridge if bridge in self.ovs_bridges else None)
|
||||
lambda bridge, log_errors: bridge if bridge in self.ovs_bridges
|
||||
else None)
|
||||
|
||||
self.execute = mock.patch('neutron.agent.common.utils.execute').start()
|
||||
self.mock_check_bridge_datapath_id = mock.patch.object(
|
||||
|
Loading…
Reference in New Issue
Block a user