Merge "ovs: survive errors from check_ovs_status"
This commit is contained in:
commit
9e6a2bc25b
@ -1778,8 +1778,12 @@ class OVSNeutronAgent(l2population_rpc.L2populationRpcCallBackTunnelMixin,
|
|||||||
port_info.get('updated'))
|
port_info.get('updated'))
|
||||||
|
|
||||||
def check_ovs_status(self):
|
def check_ovs_status(self):
|
||||||
|
try:
|
||||||
# Check for the canary flow
|
# Check for the canary flow
|
||||||
status = self.int_br.check_canary_table()
|
status = self.int_br.check_canary_table()
|
||||||
|
except Exception:
|
||||||
|
LOG.exception("Failure while checking for the canary flow")
|
||||||
|
status = constants.OVS_DEAD
|
||||||
if status == constants.OVS_RESTARTED:
|
if status == constants.OVS_RESTARTED:
|
||||||
LOG.warning("OVS is restarted. OVSNeutronAgent will reset "
|
LOG.warning("OVS is restarted. OVSNeutronAgent will reset "
|
||||||
"bridges and recover ports.")
|
"bridges and recover ports.")
|
||||||
|
@ -3514,6 +3514,14 @@ class TestOvsDvrNeutronAgent(object):
|
|||||||
pass
|
pass
|
||||||
self.assertTrue(all([x.called for x in reset_mocks]))
|
self.assertTrue(all([x.called for x in reset_mocks]))
|
||||||
|
|
||||||
|
def test_rpc_loop_survives_error_in_check_canary_table(self):
|
||||||
|
with mock.patch.object(self.agent.int_br,
|
||||||
|
'check_canary_table',
|
||||||
|
side_effect=TypeError('borked')),\
|
||||||
|
mock.patch.object(self.agent, '_check_and_handle_signal',
|
||||||
|
side_effect=[True, False]):
|
||||||
|
self.agent.rpc_loop(polling_manager=mock.Mock())
|
||||||
|
|
||||||
def _test_scan_ports_failure(self, scan_method_name):
|
def _test_scan_ports_failure(self, scan_method_name):
|
||||||
with mock.patch.object(self.agent,
|
with mock.patch.object(self.agent,
|
||||||
'check_ovs_status',
|
'check_ovs_status',
|
||||||
|
Loading…
Reference in New Issue
Block a user