diff --git a/neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py b/neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py index d70e400a998..f497c57663c 100644 --- a/neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py +++ b/neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py @@ -957,10 +957,8 @@ class LinuxBridgeNeutronAgentRPC(service.Service): try: devices_details_list = self.plugin_rpc.get_devices_details_list( self.context, devices, self.agent_id) - except Exception as e: - LOG.debug("Unable to get port details for " - "%(devices)s: %(e)s", - {'devices': devices, 'e': e}) + except Exception: + LOG.exception(_LE("Unable to get port details for %s"), devices) # resync is needed return True @@ -1017,9 +1015,9 @@ class LinuxBridgeNeutronAgentRPC(service.Service): device, self.agent_id, cfg.CONF.host) - except Exception as e: - LOG.debug("port_removed failed for %(device)s: %(e)s", - {'device': device, 'e': e}) + except Exception: + LOG.exception(_LE("Error occurred while removing port %s"), + device) resync = True if details and details['exists']: LOG.info(_LI("Port %s updated."), device) diff --git a/neutron/tests/unit/plugins/ml2/drivers/linuxbridge/agent/test_linuxbridge_neutron_agent.py b/neutron/tests/unit/plugins/ml2/drivers/linuxbridge/agent/test_linuxbridge_neutron_agent.py index 6e6092464f9..b83bbd63ad3 100644 --- a/neutron/tests/unit/plugins/ml2/drivers/linuxbridge/agent/test_linuxbridge_neutron_agent.py +++ b/neutron/tests/unit/plugins/ml2/drivers/linuxbridge/agent/test_linuxbridge_neutron_agent.py @@ -166,13 +166,10 @@ class TestLinuxBridgeAgent(base.BaseTestCase): mock.patch.object(agent.sg_agent, "remove_devices_filter") as fn_rdf: fn_udd.side_effect = Exception() - with mock.patch.object(linuxbridge_neutron_agent.LOG, - 'debug') as log: - resync = agent.treat_devices_removed(devices) - self.assertEqual(2, log.call_count) - self.assertTrue(resync) - self.assertTrue(fn_udd.called) - self.assertTrue(fn_rdf.called) + resync = agent.treat_devices_removed(devices) + self.assertTrue(resync) + self.assertTrue(fn_udd.called) + self.assertTrue(fn_rdf.called) def _test_scan_devices(self, previous, updated, fake_current, expected, sync):