VOL-3432 ONU Adapter crashes while sending the ONU Deleted Event
Change-Id: I44b40805d841c043b0eea3b9bb8cbd8a6bf20609
diff --git a/python/adapters/brcm_openomci_onu/brcm_openomci_onu_handler.py b/python/adapters/brcm_openomci_onu/brcm_openomci_onu_handler.py
index 426da70..abb73a8 100755
--- a/python/adapters/brcm_openomci_onu/brcm_openomci_onu_handler.py
+++ b/python/adapters/brcm_openomci_onu/brcm_openomci_onu_handler.py
@@ -96,6 +96,7 @@
self._test_request_started = False
self._tp = dict() # tp_id -> technology profile definition in KV Store.
self._reconciling = False
+ self.olt_serial_number = ""
# Persisted onu configuration needed in case of reconciliation.
self._onu_persisted_state = {
@@ -2005,6 +2006,7 @@
# TODO: this is expensive for just getting the olt serial number. replace with direct api call
parent_device = yield self.core_proxy.get_device(self.parent_id)
olt_serial_number = parent_device.serial_number
+ self.olt_serial_number = olt_serial_number
raised_ts = arrow.utcnow().timestamp
intf_id = self._onu_persisted_state.get('intf_id')
@@ -2068,8 +2070,7 @@
self.log.debug('onu-deleted-event')
try:
device = yield self.core_proxy.get_device(self.device_id)
- parent_device = yield self.core_proxy.get_device(self.parent_id)
- olt_serial_number = parent_device.serial_number
+ olt_serial_number = self.olt_serial_number
raised_ts = arrow.utcnow().timestamp
intf_id = self._onu_persisted_state.get('intf_id')
onu_id = self._onu_persisted_state.get('onu_id')