VOL-1049 OpenOLT - logical port not found handling
Change-Id: I9ef00883224d7390467fffe181fcb9ff372949e4
diff --git a/voltha/adapters/openolt/openolt_device.py b/voltha/adapters/openolt/openolt_device.py
index 8921761..7b3e272 100644
--- a/voltha/adapters/openolt/openolt_device.py
+++ b/voltha/adapters/openolt/openolt_device.py
@@ -757,8 +757,13 @@
def update_logical_port_stats(self, port_stats):
# FIXME
label = 'nni-{}'.format(port_stats.intf_id)
- logical_port = self.adapter_agent.get_logical_port(
- self.logical_device_id, label)
+ try:
+ logical_port = self.adapter_agent.get_logical_port(
+ self.logical_device_id, label)
+ except KeyError as e:
+ self.log.warn('logical port was not found, it may not have been '
+ 'created yet', exception=e)
+ logical_port = None
if logical_port is None:
self.log.error('logical-port-is-None',