VOL-696: ADTRAN ONU - Fix for Device ID in call to update UNI Port Status
Change-Id: I975c8ccfe519d4cc61ccc464843c625d69f7f061
diff --git a/voltha/adapters/adtran_onu/adtran_onu.py b/voltha/adapters/adtran_onu/adtran_onu.py
index d928395..b9e8c2f 100755
--- a/voltha/adapters/adtran_onu/adtran_onu.py
+++ b/voltha/adapters/adtran_onu/adtran_onu.py
@@ -36,7 +36,7 @@
device_handler_class=AdtranOnuHandler,
name='adtran_onu',
vendor='Adtran, Inc.',
- version='0.6',
+ version='0.7',
device_type='adtran_onu',
vendor_id='ADTN')
diff --git a/voltha/adapters/adtran_onu/adtran_onu_handler.py b/voltha/adapters/adtran_onu/adtran_onu_handler.py
index 0801796..86a70d5 100644
--- a/voltha/adapters/adtran_onu/adtran_onu_handler.py
+++ b/voltha/adapters/adtran_onu/adtran_onu_handler.py
@@ -785,38 +785,6 @@
if self._omci_agent is not None:
self._omci_agent.remove_device(self.device_id, cleanup=True)
self._omci_agent = None
- #
- # handling needed here
- # self.enabled = False
- #
- # # TODO: Need to implement this
- # # 1) Remove all flows from the device
- #
- # self.log.info('deleted', device_id=self.device_id)
- #
- # # Drop device ID
- # self.device_id = None @inlineCallbacks
- # def delete_v_ont_ani(self, data):
- # self.log.info('deleting-v_ont_ani')
- #
- # device = self.adapter_agent.get_device(self.device_id)
- # # construct message
- # # MIB Reset - OntData - 0
- # if device.connect_status != ConnectStatus.REACHABLE:
- # self.log.error('device-unreachable')
- # returnValue(None)
- #
- # self.send_mib_reset()
- # yield self.wait_for_response()
- # self.proxy_address = device.proxy_address
- # self.adapter_agent.unregister_for_proxied_messages(device.proxy_address)
- #
- # ports = self.adapter_agent.get_ports(self.device_id, Port.PON_ONU)
- # if ports is not None:
- # for port in ports:
- # if port.label == 'PON port':
- # self.adapter_agent.delete_port(self.device_id, port)
- # break
def _check_for_mock_config(self, data):
# Check for MOCK configuration
diff --git a/voltha/adapters/adtran_onu/pon_port.py b/voltha/adapters/adtran_onu/pon_port.py
index 2edb6f7..06fe0d3 100644
--- a/voltha/adapters/adtran_onu/pon_port.py
+++ b/voltha/adapters/adtran_onu/pon_port.py
@@ -179,15 +179,18 @@
Update the port status and state in the core
"""
self.log.debug('update-adapter-agent', admin_state=self._admin_state,
- oper_status=self._oper_status)
+ oper_status=self._oper_status)
if self._port is not None:
self._port.admin_state = self._admin_state
self._port.oper_status = self._oper_status
# adapter_agent add_port also does an update of port status
- self._handler.adapter_agent.add_port(self._handler.device_id, self.get_port())
+ try:
+ self._handler.adapter_agent.add_port(self._handler.device_id, self.get_port())
+ except Exception as e:
+ self.log.exception('update-port', e=e)
@property
def onu_omci_device(self):
diff --git a/voltha/adapters/adtran_onu/uni_port.py b/voltha/adapters/adtran_onu/uni_port.py
index d965144..9de2243 100644
--- a/voltha/adapters/adtran_onu/uni_port.py
+++ b/voltha/adapters/adtran_onu/uni_port.py
@@ -50,7 +50,7 @@
@staticmethod
def create(handler, name, port_no, ofp_port_no, subscriber_vlan, untagged_vlan):
- port = UniPort(handler, name, port_no, ofp_port_no,subscriber_vlan, untagged_vlan)
+ port = UniPort(handler, name, port_no, ofp_port_no, subscriber_vlan, untagged_vlan)
return port
def _start(self):
@@ -58,6 +58,7 @@
self._admin_state = AdminState.ENABLED
self._oper_status = OperStatus.ACTIVE
+
self._update_adapter_agent()
# TODO: start h/w sync
# TODO: Enable the actual physical port?
@@ -68,6 +69,7 @@
self._admin_state = AdminState.DISABLED
self._oper_status = OperStatus.UNKNOWN
+
self._update_adapter_agent()
# TODO: Disable/power-down the actual physical port?
pass
@@ -127,15 +129,19 @@
Update the port status and state in the core
"""
self.log.debug('update-adapter-agent', admin_state=self._admin_state,
- oper_status=self._oper_status)
+ oper_status=self._oper_status)
if self._port is not None:
self._port.admin_state = self._admin_state
self._port.oper_status = self._oper_status
- # adapter_agent add_port also does an update of existing port
- self._handler.adapter_agent.add_port(self._handler.logical_device_id,
- self.get_port())
+ try:
+ # adapter_agent add_port also does an update of existing port
+ self._handler.adapter_agent.add_port(self._handler.device_id,
+ self.get_port())
+
+ except Exception as e:
+ self.log.exception('update-port', e=e)
@staticmethod
def decode_venet(venet_info):