Browse Source

[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
changes/63/636963/4
Rodolfo Alonso Hernandez 3 years ago
parent
commit
769e971293
  1. 6
      neutron/agent/common/ovs_lib.py
  2. 3
      neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py
  3. 2
      neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_neutron_agent.py
  4. 3
      neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_tunnel.py

6
neutron/agent/common/ovs_lib.py

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

3
neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py

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

2
neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_neutron_agent.py

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

3
neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_tunnel.py

@ -186,7 +186,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…
Cancel
Save