[OVS] Exception message when retrieving bridge-id and is not present

In the OVS agent, when setting up the ancillary bridges, the parameter
external_id:bridge-id is retrieved. If this parameter is not defined
(e.g.: manually created bridges), ovsdbapp writes an error in the logs.
This information is irrelevant and can cause confusion during debugging time.

Change-Id: Ic85db65f651eb67fcb56b937ebe5850ec1e8f29f
Closes-Bug: #1815912
(cherry picked from commit 769e971293)
This commit is contained in:
Rodolfo Alonso Hernandez 2019-02-14 14:04:05 +00:00 committed by Slawek Kaplonski
parent 10de9ff017
commit f7262f5280
4 changed files with 9 additions and 5 deletions

View File

@ -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):

View File

@ -1049,7 +1049,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)

View File

@ -2413,7 +2413,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:

View File

@ -183,7 +183,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(