Cleanup logs on olt reboot
Change-Id: I66dc69814dbfe2d9d2044d05a56eb07022040c55
diff --git a/voltha/adapters/openolt/openolt_data_model.py b/voltha/adapters/openolt/openolt_data_model.py
index 8b30361..15fdde4 100644
--- a/voltha/adapters/openolt/openolt_data_model.py
+++ b/voltha/adapters/openolt/openolt_data_model.py
@@ -220,14 +220,16 @@
self._onu_serial_numbers[serial_number] = onu_info
def onu_delete(self, serial_number):
+ self.log.debug('onu_delete', serial_number=serial_number)
onu_device = self.adapter_agent.get_child_device(
self.device.id,
serial_number=serial_number)
- try:
+ if onu_device is not None:
self.adapter_agent.delete_child_device(self.device.id,
onu_device.id, onu_device)
- except Exception as e:
- self.log.error('adapter_agent error', error=e)
+ else:
+ self.log.warn('onu not found', serial_number=serial_number)
+ return
try:
self.__delete_logical_port(onu_device)
diff --git a/voltha/adapters/openolt/openolt_device.py b/voltha/adapters/openolt/openolt_device.py
index 356d0dc..9cd986d 100644
--- a/voltha/adapters/openolt/openolt_device.py
+++ b/voltha/adapters/openolt/openolt_device.py
@@ -439,7 +439,7 @@
serial_number=serial_number)
self._grpc.stub.DeleteOnu(onu)
except Exception as e:
- self.log.exception("error-deleting-the-onu-on-olt-device", error=e)
+ self.log.warn("error-deleting-the-onu-on-olt-device", error=e)
def reboot(self):
self.log.debug('rebooting openolt device')