From d4b7c8d78a407d2d1f10b32d2e6abd2a2c94e339 Mon Sep 17 00:00:00 2001
From: sgambelluri <andrea.sgambelluri@cnit.it>
Date: Fri, 13 Sep 2024 15:11:17 +0200
Subject: [PATCH] bug fix in delete

---
 bands.json                   |   1 +
 dev.logs                     | 557 +++++++++++++++++++++++++++++++++++
 links.json                   |   1 +
 src/opticalcontroller/RSA.py |  11 +-
 4 files changed, 568 insertions(+), 2 deletions(-)
 create mode 100644 bands.json
 create mode 100644 dev.logs
 create mode 100644 links.json

diff --git a/bands.json b/bands.json
new file mode 100644
index 000000000..e5d82554b
--- /dev/null
+++ b/bands.json
@@ -0,0 +1 @@
+{"1": {"optical_band_id": 1, "bidir": 0, "src": "R1", "dst": "R2", "flows": {"R1": {"f": {"in": "0", "out": "port-1-out"}, "b": {}}, "R2": {"f": {"in": "port-1-in", "out": "0"}, "b": {}}}, "band_type": "c_slots", "fiber_forward": {}, "fiber_backward": {}, "op-mode": 0, "n_slots": 16, "links": ["R1-R2"], "path": ["R1", "R2"], "band": 200000, "freq": 192106250, "is_active": false, "src_port": "port-1-out", "dst_port": "port-1-in", "rev_dst_port": "port-1-in", "rev_src_port": "port-1-out", "c_slots": {"1": 1, "2": 1, "3": 1, "4": 1, "5": 1, "6": 1, "7": 1, "8": 1, "9": 1, "10": 1, "11": 1, "12": 1, "13": 1, "14": 1, "15": 1, "16": 1}, "served_lightpaths": []}, "2": {"optical_band_id": 2, "bidir": 0, "src": "R1", "dst": "R2", "flows": {"R1": {"f": {"in": "0", "out": "port-1-out"}, "b": {}}, "R2": {"f": {"in": "port-1-in", "out": "0"}, "b": {}}}, "band_type": "c_slots", "fiber_forward": {}, "fiber_backward": {}, "op-mode": 0, "n_slots": 16, "links": ["R1-R2"], "path": ["R1", "R2"], "band": 200000, "freq": 192106250, "is_active": true, "src_port": "port-1-out", "dst_port": "port-1-in", "rev_dst_port": "port-1-in", "rev_src_port": "port-1-out", "c_slots": {"1": 0, "2": 0, "3": 0, "4": 0, "5": 0, "6": 0, "7": 0, "8": 0, "9": 0, "10": 0, "11": 0, "12": 0, "13": 0, "14": 0, "15": 0, "16": 0}, "served_lightpaths": [2, 3]}}
diff --git a/dev.logs b/dev.logs
new file mode 100644
index 000000000..67d2890be
--- /dev/null
+++ b/dev.logs
@@ -0,0 +1,557 @@
+[2024-09-13 12:09:42,326] INFO:__main__:Starting...
+[2024-09-13 12:09:42,328] INFO:device.service.DeviceService:Starting Service (tentative endpoint: 0.0.0.0:2020, max_workers: 200)...
+[2024-09-13 12:09:42,334] INFO:device.service.DeviceService:Listening on 0.0.0.0:2020...
+[2024-09-13 12:09:42,336] INFO:__main__:Pre-loading drivers...
+[2024-09-13 12:09:50,349] INFO:common.tools.client.RetryDecorator:Retry 1/15 after 5.000000 seconds...
+[2024-09-13 12:13:00,367] INFO:device.service.DeviceServiceServicerImpl:connection_config_rules {'address': '172.17.254.41', 'port': '2022', 'settings': '{\n"allow_agent": false,\n"commit_per_rule": false,\n"device_params": {\n"name": "default"\n},\n"endpoints": [],\n"force_running": false,\n"hostkey_verify": false,\n"look_for_keys": false,\n"manager_params": {\n"timeout": 120\n},\n"password": "admin",\n"type": "optical-transponder",\n"username": "admin"\n}'}
+[2024-09-13 12:13:00,367] INFO:device.service.DeviceServiceServicerImpl:lenght of connection_config_rules 3
+[2024-09-13 12:13:00,370] INFO:device.service.DeviceServiceServicerImpl:connection_config_rules {'address': '172.17.254.41', 'port': '2022', 'settings': '{\n"allow_agent": false,\n"commit_per_rule": false,\n"device_params": {\n"name": "default"\n},\n"endpoints": [],\n"force_running": false,\n"hostkey_verify": false,\n"look_for_keys": false,\n"manager_params": {\n"timeout": 120\n},\n"password": "admin",\n"type": "optical-transponder",\n"username": "admin"\n}'}
+[2024-09-13 12:13:00,370] INFO:device.service.DeviceServiceServicerImpl:lenght of connection_config_rules 3
+[2024-09-13 12:13:00,372] INFO:device.service.DeviceServiceServicerImpl:connection_config_rules {'address': '172.17.254.41', 'port': '2022', 'settings': '{\n"allow_agent": false,\n"commit_per_rule": false,\n"device_params": {\n"name": "default"\n},\n"endpoints": [],\n"force_running": false,\n"hostkey_verify": false,\n"look_for_keys": false,\n"manager_params": {\n"timeout": 120\n},\n"password": "admin",\n"type": "optical-transponder",\n"username": "admin"\n}'}
+[2024-09-13 12:13:00,372] INFO:device.service.DeviceServiceServicerImpl:lenght of connection_config_rules 3
+[2024-09-13 12:13:00,376] INFO:device.service.DeviceServiceServicerImpl:connection_config_rules {'address': '172.17.254.42', 'port': '2022', 'settings': '{\n"allow_agent": false,\n"commit_per_rule": false,\n"device_params": {\n"name": "default"\n},\n"endpoints": [],\n"force_running": false,\n"hostkey_verify": false,\n"look_for_keys": false,\n"manager_params": {\n"timeout": 120\n},\n"password": "admin",\n"type": "optical-transponder",\n"username": "admin"\n}'}
+[2024-09-13 12:13:00,377] INFO:device.service.DeviceServiceServicerImpl:connection_config_rules {'address': '172.17.254.42', 'port': '2022', 'settings': '{\n"allow_agent": false,\n"commit_per_rule": false,\n"device_params": {\n"name": "default"\n},\n"endpoints": [],\n"force_running": false,\n"hostkey_verify": false,\n"look_for_keys": false,\n"manager_params": {\n"timeout": 120\n},\n"password": "admin",\n"type": "optical-transponder",\n"username": "admin"\n}'}
+[2024-09-13 12:13:00,381] INFO:device.service.DeviceServiceServicerImpl:connection_config_rules {'address': '172.17.254.42', 'port': '2022', 'settings': '{\n"allow_agent": false,\n"commit_per_rule": false,\n"device_params": {\n"name": "default"\n},\n"endpoints": [],\n"force_running": false,\n"hostkey_verify": false,\n"look_for_keys": false,\n"manager_params": {\n"timeout": 120\n},\n"password": "admin",\n"type": "optical-transponder",\n"username": "admin"\n}'}
+[2024-09-13 12:13:00,383] INFO:device.service.DeviceServiceServicerImpl:lenght of connection_config_rules 3
+[2024-09-13 12:13:00,383] INFO:device.service.DeviceServiceServicerImpl:lenght of connection_config_rules 3
+[2024-09-13 12:13:00,383] INFO:device.service.DeviceServiceServicerImpl:lenght of connection_config_rules 3
+[2024-09-13 12:13:00,385] INFO:device.service.DeviceServiceServicerImpl:connection_config_rules {'address': '172.17.254.21', 'port': '2022', 'settings': '{\n"allow_agent": false,\n"commit_per_rule": false,\n"device_params": {\n"name": "default"\n},\n"endpoints": [],\n"force_running": false,\n"hostkey_verify": false,\n"look_for_keys": false,\n"manager_params": {\n"timeout": 120\n},\n"password": "admin",\n"type": "optical-roadm",\n"username": "admin"\n}'}
+[2024-09-13 12:13:00,386] INFO:device.service.DeviceServiceServicerImpl:connection_config_rules {'address': '172.17.254.22', 'port': '2022', 'settings': '{\n"allow_agent": false,\n"commit_per_rule": false,\n"device_params": {\n"name": "default"\n},\n"endpoints": [],\n"force_running": false,\n"hostkey_verify": false,\n"look_for_keys": false,\n"manager_params": {\n"timeout": 120\n},\n"password": "admin",\n"type": "optical-roadm",\n"username": "admin"\n}'}
+[2024-09-13 12:13:00,390] INFO:device.service.DeviceServiceServicerImpl:lenght of connection_config_rules 3
+[2024-09-13 12:13:00,390] INFO:device.service.DeviceServiceServicerImpl:lenght of connection_config_rules 3
+[2024-09-13 12:13:00,567] INFO:device.service.driver_api.DriverInstanceCache:Selecting driver for device(68741528-2e94-5274-ab3c-fddcd8dc05ef) with filter_fields({'device_type': 'optical-roadm', 'driver': [11]})...
+[2024-09-13 12:13:00,567] INFO:device.service.driver_api.DriverInstanceCache:Driver(OCDriver) selected for device(68741528-2e94-5274-ab3c-fddcd8dc05ef) with filter_fields({'device_type': 'optical-roadm', 'driver': [11]})...
+[2024-09-13 12:13:00,686] INFO:root:setting ocdriver address 172.17.254.21 and 2022 {'allow_agent': False, 'commit_per_rule': False, 'device_params': {'name': 'default'}, 'endpoints': [], 'force_running': False, 'hostkey_verify': False, 'look_for_keys': False, 'manager_params': {'timeout': 120}, 'password': 'admin', 'type': 'optical-roadm', 'username': 'admin'}
+[2024-09-13 12:13:01,705] ERROR:ncclient.transport.ssh:Exception (client): Error reading SSH protocol banner
+[2024-09-13 12:13:01,716] ERROR:ncclient.transport.ssh:Traceback (most recent call last):
+[2024-09-13 12:13:01,717] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2270, in _check_banner
+[2024-09-13 12:13:01,717] ERROR:ncclient.transport.ssh:    buf = self.packetizer.readline(timeout)
+[2024-09-13 12:13:01,717] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/packet.py", line 380, in readline
+[2024-09-13 12:13:01,717] ERROR:ncclient.transport.ssh:    buf += self._read_timeout(timeout)
+[2024-09-13 12:13:01,717] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/packet.py", line 609, in _read_timeout
+[2024-09-13 12:13:01,717] ERROR:ncclient.transport.ssh:    raise EOFError()
+[2024-09-13 12:13:01,717] ERROR:ncclient.transport.ssh:EOFError
+[2024-09-13 12:13:01,718] ERROR:ncclient.transport.ssh:
+[2024-09-13 12:13:01,718] ERROR:ncclient.transport.ssh:During handling of the above exception, another exception occurred:
+[2024-09-13 12:13:01,718] ERROR:ncclient.transport.ssh:
+[2024-09-13 12:13:01,718] ERROR:ncclient.transport.ssh:Traceback (most recent call last):
+[2024-09-13 12:13:01,718] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2093, in run
+[2024-09-13 12:13:01,718] ERROR:ncclient.transport.ssh:    self._check_banner()
+[2024-09-13 12:13:01,718] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2274, in _check_banner
+[2024-09-13 12:13:01,718] ERROR:ncclient.transport.ssh:    raise SSHException(
+[2024-09-13 12:13:01,719] ERROR:ncclient.transport.ssh:paramiko.ssh_exception.SSHException: Error reading SSH protocol banner
+[2024-09-13 12:13:01,719] ERROR:ncclient.transport.ssh:
+[2024-09-13 12:13:01,719] ERROR:device.service.DeviceServiceServicerImpl:AddDevice exception
+Traceback (most recent call last):
+  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2270, in _check_banner
+    buf = self.packetizer.readline(timeout)
+  File "/usr/local/lib/python3.9/site-packages/paramiko/packet.py", line 380, in readline
+    buf += self._read_timeout(timeout)
+  File "/usr/local/lib/python3.9/site-packages/paramiko/packet.py", line 609, in _read_timeout
+    raise EOFError()
+EOFError
+
+During handling of the above exception, another exception occurred:
+
+Traceback (most recent call last):
+  File "/usr/local/lib/python3.9/site-packages/ncclient/transport/ssh.py", line 331, in connect
+    self._transport.start_client()
+  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 698, in start_client
+    raise e
+  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2093, in run
+    self._check_banner()
+  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2274, in _check_banner
+    raise SSHException(
+paramiko.ssh_exception.SSHException: Error reading SSH protocol banner
+
+During handling of the above exception, another exception occurred:
+
+Traceback (most recent call last):
+  File "/var/teraflow/common/method_wrappers/Decorator.py", line 220, in inner_wrapper
+    reply = func(self, request, grpc_context)
+  File "/var/teraflow/device/service/DeviceServiceServicerImpl.py", line 102, in AddDevice
+    driver : _Driver = get_driver(self.driver_instance_cache, device)
+  File "/var/teraflow/device/service/driver_api/DriverInstanceCache.py", line 105, in get_driver
+    driver : _Driver = driver_instance_cache.get(
+  File "/var/teraflow/device/service/driver_api/DriverInstanceCache.py", line 57, in get
+    driver_instance : _Driver = driver_class(address, port, device_uuid=device_uuid, **settings)
+  File "/var/teraflow/device/service/drivers/oc_driver/OCDriver.py", line 234, in __init__
+    self.Connect()
+  File "/var/teraflow/device/service/drivers/oc_driver/OCDriver.py", line 240, in Connect
+    self.__netconf_handler.connect()
+  File "/var/teraflow/device/service/drivers/oc_driver/OCDriver.py", line 92, in connect
+    self.__manager = connect_ssh(
+  File "/usr/local/lib/python3.9/site-packages/ncclient/manager.py", line 143, in connect_ssh
+    session.connect(*args, **kwds)
+  File "/usr/local/lib/python3.9/site-packages/ncclient/transport/ssh.py", line 333, in connect
+    raise SSHError('Negotiation failed: %s' % e)
+ncclient.transport.errors.SSHError: Negotiation failed: Error reading SSH protocol banner
+[2024-09-13 12:13:01,722] INFO:device.service.driver_api.DriverInstanceCache:Selecting driver for device(87d74166-65e3-595e-b643-122b4fd0303f) with filter_fields({'device_type': 'optical-transponder', 'driver': [11]})...
+[2024-09-13 12:13:01,723] INFO:device.service.driver_api.DriverInstanceCache:Driver(OCDriver) selected for device(87d74166-65e3-595e-b643-122b4fd0303f) with filter_fields({'device_type': 'optical-transponder', 'driver': [11]})...
+[2024-09-13 12:13:01,724] INFO:root:setting ocdriver address 172.17.254.42 and 2022 {'allow_agent': False, 'commit_per_rule': False, 'device_params': {'name': 'default'}, 'endpoints': [], 'force_running': False, 'hostkey_verify': False, 'look_for_keys': False, 'manager_params': {'timeout': 120}, 'password': 'admin', 'type': 'optical-transponder', 'username': 'admin'}
+[2024-09-13 12:13:02,726] ERROR:ncclient.transport.ssh:Exception (client): Error reading SSH protocol banner
+[2024-09-13 12:13:02,727] ERROR:ncclient.transport.ssh:Traceback (most recent call last):
+[2024-09-13 12:13:02,727] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2270, in _check_banner
+[2024-09-13 12:13:02,727] ERROR:ncclient.transport.ssh:    buf = self.packetizer.readline(timeout)
+[2024-09-13 12:13:02,727] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/packet.py", line 380, in readline
+[2024-09-13 12:13:02,727] ERROR:ncclient.transport.ssh:    buf += self._read_timeout(timeout)
+[2024-09-13 12:13:02,727] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/packet.py", line 609, in _read_timeout
+[2024-09-13 12:13:02,727] ERROR:ncclient.transport.ssh:    raise EOFError()
+[2024-09-13 12:13:02,727] ERROR:ncclient.transport.ssh:EOFError
+[2024-09-13 12:13:02,727] ERROR:ncclient.transport.ssh:
+[2024-09-13 12:13:02,727] ERROR:ncclient.transport.ssh:During handling of the above exception, another exception occurred:
+[2024-09-13 12:13:02,728] ERROR:ncclient.transport.ssh:
+[2024-09-13 12:13:02,728] ERROR:ncclient.transport.ssh:Traceback (most recent call last):
+[2024-09-13 12:13:02,728] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2093, in run
+[2024-09-13 12:13:02,728] ERROR:ncclient.transport.ssh:    self._check_banner()
+[2024-09-13 12:13:02,728] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2274, in _check_banner
+[2024-09-13 12:13:02,728] ERROR:ncclient.transport.ssh:    raise SSHException(
+[2024-09-13 12:13:02,728] ERROR:ncclient.transport.ssh:paramiko.ssh_exception.SSHException: Error reading SSH protocol banner
+[2024-09-13 12:13:02,728] ERROR:ncclient.transport.ssh:
+[2024-09-13 12:13:02,728] ERROR:device.service.DeviceServiceServicerImpl:AddDevice exception
+Traceback (most recent call last):
+  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2270, in _check_banner
+    buf = self.packetizer.readline(timeout)
+  File "/usr/local/lib/python3.9/site-packages/paramiko/packet.py", line 380, in readline
+    buf += self._read_timeout(timeout)
+  File "/usr/local/lib/python3.9/site-packages/paramiko/packet.py", line 609, in _read_timeout
+    raise EOFError()
+EOFError
+
+During handling of the above exception, another exception occurred:
+
+Traceback (most recent call last):
+  File "/usr/local/lib/python3.9/site-packages/ncclient/transport/ssh.py", line 331, in connect
+    self._transport.start_client()
+  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 698, in start_client
+    raise e
+  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2093, in run
+    self._check_banner()
+  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2274, in _check_banner
+    raise SSHException(
+paramiko.ssh_exception.SSHException: Error reading SSH protocol banner
+
+During handling of the above exception, another exception occurred:
+
+Traceback (most recent call last):
+  File "/var/teraflow/common/method_wrappers/Decorator.py", line 220, in inner_wrapper
+    reply = func(self, request, grpc_context)
+  File "/var/teraflow/device/service/DeviceServiceServicerImpl.py", line 102, in AddDevice
+    driver : _Driver = get_driver(self.driver_instance_cache, device)
+  File "/var/teraflow/device/service/driver_api/DriverInstanceCache.py", line 105, in get_driver
+    driver : _Driver = driver_instance_cache.get(
+  File "/var/teraflow/device/service/driver_api/DriverInstanceCache.py", line 57, in get
+    driver_instance : _Driver = driver_class(address, port, device_uuid=device_uuid, **settings)
+  File "/var/teraflow/device/service/drivers/oc_driver/OCDriver.py", line 234, in __init__
+    self.Connect()
+  File "/var/teraflow/device/service/drivers/oc_driver/OCDriver.py", line 240, in Connect
+    self.__netconf_handler.connect()
+  File "/var/teraflow/device/service/drivers/oc_driver/OCDriver.py", line 92, in connect
+    self.__manager = connect_ssh(
+  File "/usr/local/lib/python3.9/site-packages/ncclient/manager.py", line 143, in connect_ssh
+    session.connect(*args, **kwds)
+  File "/usr/local/lib/python3.9/site-packages/ncclient/transport/ssh.py", line 333, in connect
+    raise SSHError('Negotiation failed: %s' % e)
+ncclient.transport.errors.SSHError: Negotiation failed: Error reading SSH protocol banner
+[2024-09-13 12:13:02,729] INFO:device.service.driver_api.DriverInstanceCache:Selecting driver for device(012c4e67-0024-5f30-b527-55ec6daf2639) with filter_fields({'device_type': 'optical-transponder', 'driver': [11]})...
+[2024-09-13 12:13:02,729] INFO:device.service.driver_api.DriverInstanceCache:Driver(OCDriver) selected for device(012c4e67-0024-5f30-b527-55ec6daf2639) with filter_fields({'device_type': 'optical-transponder', 'driver': [11]})...
+[2024-09-13 12:13:02,730] INFO:root:setting ocdriver address 172.17.254.42 and 2022 {'allow_agent': False, 'commit_per_rule': False, 'device_params': {'name': 'default'}, 'endpoints': [], 'force_running': False, 'hostkey_verify': False, 'look_for_keys': False, 'manager_params': {'timeout': 120}, 'password': 'admin', 'type': 'optical-transponder', 'username': 'admin'}
+[2024-09-13 12:13:03,732] ERROR:ncclient.transport.ssh:Exception (client): Error reading SSH protocol banner
+[2024-09-13 12:13:03,733] ERROR:ncclient.transport.ssh:Traceback (most recent call last):
+[2024-09-13 12:13:03,733] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2270, in _check_banner
+[2024-09-13 12:13:03,733] ERROR:ncclient.transport.ssh:    buf = self.packetizer.readline(timeout)
+[2024-09-13 12:13:03,733] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/packet.py", line 380, in readline
+[2024-09-13 12:13:03,733] ERROR:ncclient.transport.ssh:    buf += self._read_timeout(timeout)
+[2024-09-13 12:13:03,733] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/packet.py", line 609, in _read_timeout
+[2024-09-13 12:13:03,733] ERROR:ncclient.transport.ssh:    raise EOFError()
+[2024-09-13 12:13:03,733] ERROR:ncclient.transport.ssh:EOFError
+[2024-09-13 12:13:03,733] ERROR:ncclient.transport.ssh:
+[2024-09-13 12:13:03,733] ERROR:ncclient.transport.ssh:During handling of the above exception, another exception occurred:
+[2024-09-13 12:13:03,733] ERROR:ncclient.transport.ssh:
+[2024-09-13 12:13:03,733] ERROR:ncclient.transport.ssh:Traceback (most recent call last):
+[2024-09-13 12:13:03,733] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2093, in run
+[2024-09-13 12:13:03,733] ERROR:ncclient.transport.ssh:    self._check_banner()
+[2024-09-13 12:13:03,734] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2274, in _check_banner
+[2024-09-13 12:13:03,734] ERROR:ncclient.transport.ssh:    raise SSHException(
+[2024-09-13 12:13:03,734] ERROR:ncclient.transport.ssh:paramiko.ssh_exception.SSHException: Error reading SSH protocol banner
+[2024-09-13 12:13:03,734] ERROR:ncclient.transport.ssh:
+[2024-09-13 12:13:03,737] ERROR:device.service.DeviceServiceServicerImpl:AddDevice exception
+Traceback (most recent call last):
+  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2270, in _check_banner
+    buf = self.packetizer.readline(timeout)
+  File "/usr/local/lib/python3.9/site-packages/paramiko/packet.py", line 380, in readline
+    buf += self._read_timeout(timeout)
+  File "/usr/local/lib/python3.9/site-packages/paramiko/packet.py", line 609, in _read_timeout
+    raise EOFError()
+EOFError
+
+During handling of the above exception, another exception occurred:
+
+Traceback (most recent call last):
+  File "/usr/local/lib/python3.9/site-packages/ncclient/transport/ssh.py", line 331, in connect
+    self._transport.start_client()
+  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 698, in start_client
+    raise e
+  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2093, in run
+    self._check_banner()
+  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2274, in _check_banner
+    raise SSHException(
+paramiko.ssh_exception.SSHException: Error reading SSH protocol banner
+
+During handling of the above exception, another exception occurred:
+
+Traceback (most recent call last):
+  File "/var/teraflow/common/method_wrappers/Decorator.py", line 220, in inner_wrapper
+    reply = func(self, request, grpc_context)
+  File "/var/teraflow/device/service/DeviceServiceServicerImpl.py", line 102, in AddDevice
+    driver : _Driver = get_driver(self.driver_instance_cache, device)
+  File "/var/teraflow/device/service/driver_api/DriverInstanceCache.py", line 105, in get_driver
+    driver : _Driver = driver_instance_cache.get(
+  File "/var/teraflow/device/service/driver_api/DriverInstanceCache.py", line 57, in get
+    driver_instance : _Driver = driver_class(address, port, device_uuid=device_uuid, **settings)
+  File "/var/teraflow/device/service/drivers/oc_driver/OCDriver.py", line 234, in __init__
+    self.Connect()
+  File "/var/teraflow/device/service/drivers/oc_driver/OCDriver.py", line 240, in Connect
+    self.__netconf_handler.connect()
+  File "/var/teraflow/device/service/drivers/oc_driver/OCDriver.py", line 92, in connect
+    self.__manager = connect_ssh(
+  File "/usr/local/lib/python3.9/site-packages/ncclient/manager.py", line 143, in connect_ssh
+    session.connect(*args, **kwds)
+  File "/usr/local/lib/python3.9/site-packages/ncclient/transport/ssh.py", line 333, in connect
+    raise SSHError('Negotiation failed: %s' % e)
+ncclient.transport.errors.SSHError: Negotiation failed: Error reading SSH protocol banner
+[2024-09-13 12:13:03,737] INFO:device.service.driver_api.DriverInstanceCache:Selecting driver for device(4dbdc2d8-cbde-5e48-a3c0-5161387a58c7) with filter_fields({'device_type': 'optical-transponder', 'driver': [11]})...
+[2024-09-13 12:13:03,738] INFO:device.service.driver_api.DriverInstanceCache:Driver(OCDriver) selected for device(4dbdc2d8-cbde-5e48-a3c0-5161387a58c7) with filter_fields({'device_type': 'optical-transponder', 'driver': [11]})...
+[2024-09-13 12:13:03,739] INFO:root:setting ocdriver address 172.17.254.41 and 2022 {'allow_agent': False, 'commit_per_rule': False, 'device_params': {'name': 'default'}, 'endpoints': [], 'force_running': False, 'hostkey_verify': False, 'look_for_keys': False, 'manager_params': {'timeout': 120}, 'password': 'admin', 'type': 'optical-transponder', 'username': 'admin'}
+[2024-09-13 12:13:04,742] ERROR:ncclient.transport.ssh:Exception (client): Error reading SSH protocol banner
+[2024-09-13 12:13:04,743] ERROR:ncclient.transport.ssh:Traceback (most recent call last):
+[2024-09-13 12:13:04,743] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2270, in _check_banner
+[2024-09-13 12:13:04,743] ERROR:ncclient.transport.ssh:    buf = self.packetizer.readline(timeout)
+[2024-09-13 12:13:04,743] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/packet.py", line 380, in readline
+[2024-09-13 12:13:04,743] ERROR:ncclient.transport.ssh:    buf += self._read_timeout(timeout)
+[2024-09-13 12:13:04,743] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/packet.py", line 609, in _read_timeout
+[2024-09-13 12:13:04,743] ERROR:ncclient.transport.ssh:    raise EOFError()
+[2024-09-13 12:13:04,743] ERROR:ncclient.transport.ssh:EOFError
+[2024-09-13 12:13:04,743] ERROR:ncclient.transport.ssh:
+[2024-09-13 12:13:04,743] ERROR:ncclient.transport.ssh:During handling of the above exception, another exception occurred:
+[2024-09-13 12:13:04,743] ERROR:ncclient.transport.ssh:
+[2024-09-13 12:13:04,743] ERROR:ncclient.transport.ssh:Traceback (most recent call last):
+[2024-09-13 12:13:04,744] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2093, in run
+[2024-09-13 12:13:04,744] ERROR:ncclient.transport.ssh:    self._check_banner()
+[2024-09-13 12:13:04,744] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2274, in _check_banner
+[2024-09-13 12:13:04,744] ERROR:ncclient.transport.ssh:    raise SSHException(
+[2024-09-13 12:13:04,744] ERROR:ncclient.transport.ssh:paramiko.ssh_exception.SSHException: Error reading SSH protocol banner
+[2024-09-13 12:13:04,744] ERROR:ncclient.transport.ssh:
+[2024-09-13 12:13:04,744] ERROR:device.service.DeviceServiceServicerImpl:AddDevice exception
+Traceback (most recent call last):
+  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2270, in _check_banner
+    buf = self.packetizer.readline(timeout)
+  File "/usr/local/lib/python3.9/site-packages/paramiko/packet.py", line 380, in readline
+    buf += self._read_timeout(timeout)
+  File "/usr/local/lib/python3.9/site-packages/paramiko/packet.py", line 609, in _read_timeout
+    raise EOFError()
+EOFError
+
+During handling of the above exception, another exception occurred:
+
+Traceback (most recent call last):
+  File "/usr/local/lib/python3.9/site-packages/ncclient/transport/ssh.py", line 331, in connect
+    self._transport.start_client()
+  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 698, in start_client
+    raise e
+  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2093, in run
+    self._check_banner()
+  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2274, in _check_banner
+    raise SSHException(
+paramiko.ssh_exception.SSHException: Error reading SSH protocol banner
+
+During handling of the above exception, another exception occurred:
+
+Traceback (most recent call last):
+  File "/var/teraflow/common/method_wrappers/Decorator.py", line 220, in inner_wrapper
+    reply = func(self, request, grpc_context)
+  File "/var/teraflow/device/service/DeviceServiceServicerImpl.py", line 102, in AddDevice
+    driver : _Driver = get_driver(self.driver_instance_cache, device)
+  File "/var/teraflow/device/service/driver_api/DriverInstanceCache.py", line 105, in get_driver
+    driver : _Driver = driver_instance_cache.get(
+  File "/var/teraflow/device/service/driver_api/DriverInstanceCache.py", line 57, in get
+    driver_instance : _Driver = driver_class(address, port, device_uuid=device_uuid, **settings)
+  File "/var/teraflow/device/service/drivers/oc_driver/OCDriver.py", line 234, in __init__
+    self.Connect()
+  File "/var/teraflow/device/service/drivers/oc_driver/OCDriver.py", line 240, in Connect
+    self.__netconf_handler.connect()
+  File "/var/teraflow/device/service/drivers/oc_driver/OCDriver.py", line 92, in connect
+    self.__manager = connect_ssh(
+  File "/usr/local/lib/python3.9/site-packages/ncclient/manager.py", line 143, in connect_ssh
+    session.connect(*args, **kwds)
+  File "/usr/local/lib/python3.9/site-packages/ncclient/transport/ssh.py", line 333, in connect
+    raise SSHError('Negotiation failed: %s' % e)
+ncclient.transport.errors.SSHError: Negotiation failed: Error reading SSH protocol banner
+[2024-09-13 12:13:04,744] INFO:device.service.driver_api.DriverInstanceCache:Selecting driver for device(cf618e18-c0a1-58c4-9827-943a2c0523d6) with filter_fields({'device_type': 'optical-transponder', 'driver': [11]})...
+[2024-09-13 12:13:04,745] INFO:device.service.driver_api.DriverInstanceCache:Driver(OCDriver) selected for device(cf618e18-c0a1-58c4-9827-943a2c0523d6) with filter_fields({'device_type': 'optical-transponder', 'driver': [11]})...
+[2024-09-13 12:13:04,746] INFO:root:setting ocdriver address 172.17.254.41 and 2022 {'allow_agent': False, 'commit_per_rule': False, 'device_params': {'name': 'default'}, 'endpoints': [], 'force_running': False, 'hostkey_verify': False, 'look_for_keys': False, 'manager_params': {'timeout': 120}, 'password': 'admin', 'type': 'optical-transponder', 'username': 'admin'}
+[2024-09-13 12:13:05,748] ERROR:ncclient.transport.ssh:Exception (client): Error reading SSH protocol banner
+[2024-09-13 12:13:05,748] ERROR:ncclient.transport.ssh:Traceback (most recent call last):
+[2024-09-13 12:13:05,748] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2270, in _check_banner
+[2024-09-13 12:13:05,748] ERROR:ncclient.transport.ssh:    buf = self.packetizer.readline(timeout)
+[2024-09-13 12:13:05,749] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/packet.py", line 380, in readline
+[2024-09-13 12:13:05,749] ERROR:ncclient.transport.ssh:    buf += self._read_timeout(timeout)
+[2024-09-13 12:13:05,749] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/packet.py", line 609, in _read_timeout
+[2024-09-13 12:13:05,749] ERROR:ncclient.transport.ssh:    raise EOFError()
+[2024-09-13 12:13:05,749] ERROR:ncclient.transport.ssh:EOFError
+[2024-09-13 12:13:05,749] ERROR:ncclient.transport.ssh:
+[2024-09-13 12:13:05,750] ERROR:ncclient.transport.ssh:During handling of the above exception, another exception occurred:
+[2024-09-13 12:13:05,750] ERROR:ncclient.transport.ssh:
+[2024-09-13 12:13:05,750] ERROR:ncclient.transport.ssh:Traceback (most recent call last):
+[2024-09-13 12:13:05,750] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2093, in run
+[2024-09-13 12:13:05,750] ERROR:ncclient.transport.ssh:    self._check_banner()
+[2024-09-13 12:13:05,751] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2274, in _check_banner
+[2024-09-13 12:13:05,751] ERROR:ncclient.transport.ssh:    raise SSHException(
+[2024-09-13 12:13:05,751] ERROR:ncclient.transport.ssh:paramiko.ssh_exception.SSHException: Error reading SSH protocol banner
+[2024-09-13 12:13:05,751] ERROR:ncclient.transport.ssh:
+[2024-09-13 12:13:05,752] ERROR:device.service.DeviceServiceServicerImpl:AddDevice exception
+Traceback (most recent call last):
+  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2270, in _check_banner
+    buf = self.packetizer.readline(timeout)
+  File "/usr/local/lib/python3.9/site-packages/paramiko/packet.py", line 380, in readline
+    buf += self._read_timeout(timeout)
+  File "/usr/local/lib/python3.9/site-packages/paramiko/packet.py", line 609, in _read_timeout
+    raise EOFError()
+EOFError
+
+During handling of the above exception, another exception occurred:
+
+Traceback (most recent call last):
+  File "/usr/local/lib/python3.9/site-packages/ncclient/transport/ssh.py", line 331, in connect
+    self._transport.start_client()
+  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 698, in start_client
+    raise e
+  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2093, in run
+    self._check_banner()
+  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2274, in _check_banner
+    raise SSHException(
+paramiko.ssh_exception.SSHException: Error reading SSH protocol banner
+
+During handling of the above exception, another exception occurred:
+
+Traceback (most recent call last):
+  File "/var/teraflow/common/method_wrappers/Decorator.py", line 220, in inner_wrapper
+    reply = func(self, request, grpc_context)
+  File "/var/teraflow/device/service/DeviceServiceServicerImpl.py", line 102, in AddDevice
+    driver : _Driver = get_driver(self.driver_instance_cache, device)
+  File "/var/teraflow/device/service/driver_api/DriverInstanceCache.py", line 105, in get_driver
+    driver : _Driver = driver_instance_cache.get(
+  File "/var/teraflow/device/service/driver_api/DriverInstanceCache.py", line 57, in get
+    driver_instance : _Driver = driver_class(address, port, device_uuid=device_uuid, **settings)
+  File "/var/teraflow/device/service/drivers/oc_driver/OCDriver.py", line 234, in __init__
+    self.Connect()
+  File "/var/teraflow/device/service/drivers/oc_driver/OCDriver.py", line 240, in Connect
+    self.__netconf_handler.connect()
+  File "/var/teraflow/device/service/drivers/oc_driver/OCDriver.py", line 92, in connect
+    self.__manager = connect_ssh(
+  File "/usr/local/lib/python3.9/site-packages/ncclient/manager.py", line 143, in connect_ssh
+    session.connect(*args, **kwds)
+  File "/usr/local/lib/python3.9/site-packages/ncclient/transport/ssh.py", line 333, in connect
+    raise SSHError('Negotiation failed: %s' % e)
+ncclient.transport.errors.SSHError: Negotiation failed: Error reading SSH protocol banner
+[2024-09-13 12:13:05,752] INFO:device.service.driver_api.DriverInstanceCache:Selecting driver for device(27c2ed23-e74a-518f-820d-ae2c8ae23086) with filter_fields({'device_type': 'optical-transponder', 'driver': [11]})...
+[2024-09-13 12:13:05,753] INFO:device.service.driver_api.DriverInstanceCache:Driver(OCDriver) selected for device(27c2ed23-e74a-518f-820d-ae2c8ae23086) with filter_fields({'device_type': 'optical-transponder', 'driver': [11]})...
+[2024-09-13 12:13:05,754] INFO:root:setting ocdriver address 172.17.254.41 and 2022 {'allow_agent': False, 'commit_per_rule': False, 'device_params': {'name': 'default'}, 'endpoints': [], 'force_running': False, 'hostkey_verify': False, 'look_for_keys': False, 'manager_params': {'timeout': 120}, 'password': 'admin', 'type': 'optical-transponder', 'username': 'admin'}
+[2024-09-13 12:13:06,756] ERROR:ncclient.transport.ssh:Exception (client): Error reading SSH protocol banner
+[2024-09-13 12:13:06,756] ERROR:ncclient.transport.ssh:Traceback (most recent call last):
+[2024-09-13 12:13:06,756] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2270, in _check_banner
+[2024-09-13 12:13:06,757] ERROR:ncclient.transport.ssh:    buf = self.packetizer.readline(timeout)
+[2024-09-13 12:13:06,757] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/packet.py", line 380, in readline
+[2024-09-13 12:13:06,757] ERROR:ncclient.transport.ssh:    buf += self._read_timeout(timeout)
+[2024-09-13 12:13:06,757] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/packet.py", line 609, in _read_timeout
+[2024-09-13 12:13:06,757] ERROR:ncclient.transport.ssh:    raise EOFError()
+[2024-09-13 12:13:06,757] ERROR:ncclient.transport.ssh:EOFError
+[2024-09-13 12:13:06,757] ERROR:ncclient.transport.ssh:
+[2024-09-13 12:13:06,757] ERROR:ncclient.transport.ssh:During handling of the above exception, another exception occurred:
+[2024-09-13 12:13:06,758] ERROR:ncclient.transport.ssh:
+[2024-09-13 12:13:06,758] ERROR:ncclient.transport.ssh:Traceback (most recent call last):
+[2024-09-13 12:13:06,758] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2093, in run
+[2024-09-13 12:13:06,758] ERROR:ncclient.transport.ssh:    self._check_banner()
+[2024-09-13 12:13:06,758] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2274, in _check_banner
+[2024-09-13 12:13:06,758] ERROR:ncclient.transport.ssh:    raise SSHException(
+[2024-09-13 12:13:06,758] ERROR:ncclient.transport.ssh:paramiko.ssh_exception.SSHException: Error reading SSH protocol banner
+[2024-09-13 12:13:06,758] ERROR:ncclient.transport.ssh:
+[2024-09-13 12:13:06,759] ERROR:device.service.DeviceServiceServicerImpl:AddDevice exception
+Traceback (most recent call last):
+  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2270, in _check_banner
+    buf = self.packetizer.readline(timeout)
+  File "/usr/local/lib/python3.9/site-packages/paramiko/packet.py", line 380, in readline
+    buf += self._read_timeout(timeout)
+  File "/usr/local/lib/python3.9/site-packages/paramiko/packet.py", line 609, in _read_timeout
+    raise EOFError()
+EOFError
+
+During handling of the above exception, another exception occurred:
+
+Traceback (most recent call last):
+  File "/usr/local/lib/python3.9/site-packages/ncclient/transport/ssh.py", line 331, in connect
+    self._transport.start_client()
+  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 698, in start_client
+    raise e
+  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2093, in run
+    self._check_banner()
+  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2274, in _check_banner
+    raise SSHException(
+paramiko.ssh_exception.SSHException: Error reading SSH protocol banner
+
+During handling of the above exception, another exception occurred:
+
+Traceback (most recent call last):
+  File "/var/teraflow/common/method_wrappers/Decorator.py", line 220, in inner_wrapper
+    reply = func(self, request, grpc_context)
+  File "/var/teraflow/device/service/DeviceServiceServicerImpl.py", line 102, in AddDevice
+    driver : _Driver = get_driver(self.driver_instance_cache, device)
+  File "/var/teraflow/device/service/driver_api/DriverInstanceCache.py", line 105, in get_driver
+    driver : _Driver = driver_instance_cache.get(
+  File "/var/teraflow/device/service/driver_api/DriverInstanceCache.py", line 57, in get
+    driver_instance : _Driver = driver_class(address, port, device_uuid=device_uuid, **settings)
+  File "/var/teraflow/device/service/drivers/oc_driver/OCDriver.py", line 234, in __init__
+    self.Connect()
+  File "/var/teraflow/device/service/drivers/oc_driver/OCDriver.py", line 240, in Connect
+    self.__netconf_handler.connect()
+  File "/var/teraflow/device/service/drivers/oc_driver/OCDriver.py", line 92, in connect
+    self.__manager = connect_ssh(
+  File "/usr/local/lib/python3.9/site-packages/ncclient/manager.py", line 143, in connect_ssh
+    session.connect(*args, **kwds)
+  File "/usr/local/lib/python3.9/site-packages/ncclient/transport/ssh.py", line 333, in connect
+    raise SSHError('Negotiation failed: %s' % e)
+ncclient.transport.errors.SSHError: Negotiation failed: Error reading SSH protocol banner
+[2024-09-13 12:13:06,759] INFO:device.service.driver_api.DriverInstanceCache:Selecting driver for device(c944aaeb-bbdf-5f2d-b31c-8cc8903045b6) with filter_fields({'device_type': 'optical-roadm', 'driver': [11]})...
+[2024-09-13 12:13:06,760] INFO:device.service.driver_api.DriverInstanceCache:Driver(OCDriver) selected for device(c944aaeb-bbdf-5f2d-b31c-8cc8903045b6) with filter_fields({'device_type': 'optical-roadm', 'driver': [11]})...
+[2024-09-13 12:13:06,760] INFO:root:setting ocdriver address 172.17.254.22 and 2022 {'allow_agent': False, 'commit_per_rule': False, 'device_params': {'name': 'default'}, 'endpoints': [], 'force_running': False, 'hostkey_verify': False, 'look_for_keys': False, 'manager_params': {'timeout': 120}, 'password': 'admin', 'type': 'optical-roadm', 'username': 'admin'}
+[2024-09-13 12:13:07,763] ERROR:ncclient.transport.ssh:Exception (client): Error reading SSH protocol banner
+[2024-09-13 12:13:07,764] ERROR:ncclient.transport.ssh:Traceback (most recent call last):
+[2024-09-13 12:13:07,764] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2270, in _check_banner
+[2024-09-13 12:13:07,764] ERROR:ncclient.transport.ssh:    buf = self.packetizer.readline(timeout)
+[2024-09-13 12:13:07,764] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/packet.py", line 380, in readline
+[2024-09-13 12:13:07,764] ERROR:ncclient.transport.ssh:    buf += self._read_timeout(timeout)
+[2024-09-13 12:13:07,764] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/packet.py", line 609, in _read_timeout
+[2024-09-13 12:13:07,764] ERROR:ncclient.transport.ssh:    raise EOFError()
+[2024-09-13 12:13:07,764] ERROR:ncclient.transport.ssh:EOFError
+[2024-09-13 12:13:07,764] ERROR:ncclient.transport.ssh:
+[2024-09-13 12:13:07,765] ERROR:ncclient.transport.ssh:During handling of the above exception, another exception occurred:
+[2024-09-13 12:13:07,765] ERROR:ncclient.transport.ssh:
+[2024-09-13 12:13:07,765] ERROR:ncclient.transport.ssh:Traceback (most recent call last):
+[2024-09-13 12:13:07,765] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2093, in run
+[2024-09-13 12:13:07,765] ERROR:ncclient.transport.ssh:    self._check_banner()
+[2024-09-13 12:13:07,765] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2274, in _check_banner
+[2024-09-13 12:13:07,765] ERROR:ncclient.transport.ssh:    raise SSHException(
+[2024-09-13 12:13:07,765] ERROR:ncclient.transport.ssh:paramiko.ssh_exception.SSHException: Error reading SSH protocol banner
+[2024-09-13 12:13:07,765] ERROR:ncclient.transport.ssh:
+[2024-09-13 12:13:07,765] ERROR:device.service.DeviceServiceServicerImpl:AddDevice exception
+Traceback (most recent call last):
+  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2270, in _check_banner
+    buf = self.packetizer.readline(timeout)
+  File "/usr/local/lib/python3.9/site-packages/paramiko/packet.py", line 380, in readline
+    buf += self._read_timeout(timeout)
+  File "/usr/local/lib/python3.9/site-packages/paramiko/packet.py", line 609, in _read_timeout
+    raise EOFError()
+EOFError
+
+During handling of the above exception, another exception occurred:
+
+Traceback (most recent call last):
+  File "/usr/local/lib/python3.9/site-packages/ncclient/transport/ssh.py", line 331, in connect
+    self._transport.start_client()
+  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 698, in start_client
+    raise e
+  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2093, in run
+    self._check_banner()
+  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2274, in _check_banner
+    raise SSHException(
+paramiko.ssh_exception.SSHException: Error reading SSH protocol banner
+
+During handling of the above exception, another exception occurred:
+
+Traceback (most recent call last):
+  File "/var/teraflow/common/method_wrappers/Decorator.py", line 220, in inner_wrapper
+    reply = func(self, request, grpc_context)
+  File "/var/teraflow/device/service/DeviceServiceServicerImpl.py", line 102, in AddDevice
+    driver : _Driver = get_driver(self.driver_instance_cache, device)
+  File "/var/teraflow/device/service/driver_api/DriverInstanceCache.py", line 105, in get_driver
+    driver : _Driver = driver_instance_cache.get(
+  File "/var/teraflow/device/service/driver_api/DriverInstanceCache.py", line 57, in get
+    driver_instance : _Driver = driver_class(address, port, device_uuid=device_uuid, **settings)
+  File "/var/teraflow/device/service/drivers/oc_driver/OCDriver.py", line 234, in __init__
+    self.Connect()
+  File "/var/teraflow/device/service/drivers/oc_driver/OCDriver.py", line 240, in Connect
+    self.__netconf_handler.connect()
+  File "/var/teraflow/device/service/drivers/oc_driver/OCDriver.py", line 92, in connect
+    self.__manager = connect_ssh(
+  File "/usr/local/lib/python3.9/site-packages/ncclient/manager.py", line 143, in connect_ssh
+    session.connect(*args, **kwds)
+  File "/usr/local/lib/python3.9/site-packages/ncclient/transport/ssh.py", line 333, in connect
+    raise SSHError('Negotiation failed: %s' % e)
+ncclient.transport.errors.SSHError: Negotiation failed: Error reading SSH protocol banner
+[2024-09-13 12:13:07,766] INFO:device.service.driver_api.DriverInstanceCache:Selecting driver for device(ce0cdfdd-2182-5027-8177-676ca3244f9d) with filter_fields({'device_type': 'optical-transponder', 'driver': [11]})...
+[2024-09-13 12:13:07,766] INFO:device.service.driver_api.DriverInstanceCache:Driver(OCDriver) selected for device(ce0cdfdd-2182-5027-8177-676ca3244f9d) with filter_fields({'device_type': 'optical-transponder', 'driver': [11]})...
+[2024-09-13 12:13:07,767] INFO:root:setting ocdriver address 172.17.254.42 and 2022 {'allow_agent': False, 'commit_per_rule': False, 'device_params': {'name': 'default'}, 'endpoints': [], 'force_running': False, 'hostkey_verify': False, 'look_for_keys': False, 'manager_params': {'timeout': 120}, 'password': 'admin', 'type': 'optical-transponder', 'username': 'admin'}
+[2024-09-13 12:13:08,769] ERROR:ncclient.transport.ssh:Exception (client): Error reading SSH protocol banner
+[2024-09-13 12:13:08,769] ERROR:ncclient.transport.ssh:Traceback (most recent call last):
+[2024-09-13 12:13:08,770] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2270, in _check_banner
+[2024-09-13 12:13:08,770] ERROR:ncclient.transport.ssh:    buf = self.packetizer.readline(timeout)
+[2024-09-13 12:13:08,770] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/packet.py", line 380, in readline
+[2024-09-13 12:13:08,770] ERROR:ncclient.transport.ssh:    buf += self._read_timeout(timeout)
+[2024-09-13 12:13:08,770] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/packet.py", line 609, in _read_timeout
+[2024-09-13 12:13:08,770] ERROR:ncclient.transport.ssh:    raise EOFError()
+[2024-09-13 12:13:08,770] ERROR:ncclient.transport.ssh:EOFError
+[2024-09-13 12:13:08,770] ERROR:ncclient.transport.ssh:
+[2024-09-13 12:13:08,770] ERROR:ncclient.transport.ssh:During handling of the above exception, another exception occurred:
+[2024-09-13 12:13:08,770] ERROR:ncclient.transport.ssh:
+[2024-09-13 12:13:08,770] ERROR:ncclient.transport.ssh:Traceback (most recent call last):
+[2024-09-13 12:13:08,770] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2093, in run
+[2024-09-13 12:13:08,770] ERROR:ncclient.transport.ssh:    self._check_banner()
+[2024-09-13 12:13:08,771] ERROR:ncclient.transport.ssh:  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2274, in _check_banner
+[2024-09-13 12:13:08,771] ERROR:ncclient.transport.ssh:    raise SSHException(
+[2024-09-13 12:13:08,771] ERROR:ncclient.transport.ssh:paramiko.ssh_exception.SSHException: Error reading SSH protocol banner
+[2024-09-13 12:13:08,771] ERROR:ncclient.transport.ssh:
+[2024-09-13 12:13:08,771] ERROR:device.service.DeviceServiceServicerImpl:AddDevice exception
+Traceback (most recent call last):
+  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2270, in _check_banner
+    buf = self.packetizer.readline(timeout)
+  File "/usr/local/lib/python3.9/site-packages/paramiko/packet.py", line 380, in readline
+    buf += self._read_timeout(timeout)
+  File "/usr/local/lib/python3.9/site-packages/paramiko/packet.py", line 609, in _read_timeout
+    raise EOFError()
+EOFError
+
+During handling of the above exception, another exception occurred:
+
+Traceback (most recent call last):
+  File "/usr/local/lib/python3.9/site-packages/ncclient/transport/ssh.py", line 331, in connect
+    self._transport.start_client()
+  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 698, in start_client
+    raise e
+  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2093, in run
+    self._check_banner()
+  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2274, in _check_banner
+    raise SSHException(
+paramiko.ssh_exception.SSHException: Error reading SSH protocol banner
+
+During handling of the above exception, another exception occurred:
+
+Traceback (most recent call last):
+  File "/var/teraflow/common/method_wrappers/Decorator.py", line 220, in inner_wrapper
+    reply = func(self, request, grpc_context)
+  File "/var/teraflow/device/service/DeviceServiceServicerImpl.py", line 102, in AddDevice
+    driver : _Driver = get_driver(self.driver_instance_cache, device)
+  File "/var/teraflow/device/service/driver_api/DriverInstanceCache.py", line 105, in get_driver
+    driver : _Driver = driver_instance_cache.get(
+  File "/var/teraflow/device/service/driver_api/DriverInstanceCache.py", line 57, in get
+    driver_instance : _Driver = driver_class(address, port, device_uuid=device_uuid, **settings)
+  File "/var/teraflow/device/service/drivers/oc_driver/OCDriver.py", line 234, in __init__
+    self.Connect()
+  File "/var/teraflow/device/service/drivers/oc_driver/OCDriver.py", line 240, in Connect
+    self.__netconf_handler.connect()
+  File "/var/teraflow/device/service/drivers/oc_driver/OCDriver.py", line 92, in connect
+    self.__manager = connect_ssh(
+  File "/usr/local/lib/python3.9/site-packages/ncclient/manager.py", line 143, in connect_ssh
+    session.connect(*args, **kwds)
+  File "/usr/local/lib/python3.9/site-packages/ncclient/transport/ssh.py", line 333, in connect
+    raise SSHError('Negotiation failed: %s' % e)
+ncclient.transport.errors.SSHError: Negotiation failed: Error reading SSH protocol banner
diff --git a/links.json b/links.json
new file mode 100644
index 000000000..bd13886a3
--- /dev/null
+++ b/links.json
@@ -0,0 +1 @@
+{"optical_links": [{"name": "R2-T2.1", "optical_details": {"src_port": "port-33-out", "dst_port": "1", "local_peer_port": "port-33-in", "remote_peer_port": "1", "c_slots": {"1": 0, "2": 0, "3": 0, "4": 0, "5": 0, "6": 0, "7": 0, "8": 0, "9": 1, "10": 1, "11": 1, "12": 1, "13": 1, "14": 1, "15": 1, "16": 1, "17": 1, "18": 1, "19": 1, "20": 1, "21": 1, "22": 1, "23": 1, "24": 1, "25": 1, "26": 1, "27": 1, "28": 1, "29": 1, "30": 1}, "l_slots": {"101": 1, "102": 1, "103": 1, "104": 1, "105": 1, "106": 1, "107": 1, "108": 1, "109": 1, "110": 1, "111": 1, "112": 1, "113": 1, "114": 1, "115": 1, "116": 1, "117": 1, "118": 1, "119": 1, "120": 1}, "s_slots": {"501": 1, "502": 1, "503": 1, "504": 1, "505": 1, "506": 1, "507": 1, "508": 1, "509": 1, "510": 1, "511": 1, "512": 1, "513": 1, "514": 1, "515": 1, "516": 1, "517": 1, "518": 1, "519": 1, "520": 1}}, "link_id": {"link_uuid": {"uuid": "5ba1d9b6-120a-5680-b745-2ea24aec1cc3"}}, "link_endpoint_ids": [{"topology_id": {"context_id": {"context_uuid": {"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"}}, "topology_uuid": {"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"}}, "device_id": {"device_uuid": {"uuid": "87d74166-65e3-595e-b643-122b4fd0303f"}}, "endpoint_uuid": {"uuid": "2a307a8e-d326-5ea2-9437-b0320fb4c2a6"}}, {"topology_id": {"context_id": {"context_uuid": {"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"}}, "topology_uuid": {"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"}}, "device_id": {"device_uuid": {"uuid": "c944aaeb-bbdf-5f2d-b31c-8cc8903045b6"}}, "endpoint_uuid": {"uuid": "76d3c064-04eb-5edf-95ac-645cb6348b61"}}]}, {"name": "R2-T2.2", "optical_details": {"src_port": "port-34-out", "dst_port": "2", "local_peer_port": "port-34-in", "remote_peer_port": "2", "c_slots": {"1": 1, "2": 1, "3": 1, "4": 1, "5": 1, "6": 1, "7": 1, "8": 1, "9": 0, "10": 0, "11": 0, "12": 0, "13": 0, "14": 0, "15": 0, "16": 0, "17": 1, "18": 1, "19": 1, "20": 1, "21": 1, "22": 1, "23": 1, "24": 1, "25": 1, "26": 1, "27": 1, "28": 1, "29": 1, "30": 1}, "l_slots": {"101": 1, "102": 1, "103": 1, "104": 1, "105": 1, "106": 1, "107": 1, "108": 1, "109": 1, "110": 1, "111": 1, "112": 1, "113": 1, "114": 1, "115": 1, "116": 1, "117": 1, "118": 1, "119": 1, "120": 1}, "s_slots": {"501": 1, "502": 1, "503": 1, "504": 1, "505": 1, "506": 1, "507": 1, "508": 1, "509": 1, "510": 1, "511": 1, "512": 1, "513": 1, "514": 1, "515": 1, "516": 1, "517": 1, "518": 1, "519": 1, "520": 1}}, "link_id": {"link_uuid": {"uuid": "5f9f4309-d24d-52e0-9d60-ba84839a5bda"}}, "link_endpoint_ids": [{"topology_id": {"context_id": {"context_uuid": {"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"}}, "topology_uuid": {"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"}}, "device_id": {"device_uuid": {"uuid": "c944aaeb-bbdf-5f2d-b31c-8cc8903045b6"}}, "endpoint_uuid": {"uuid": "5dd55ad7-b980-562e-b579-d724a3655d31"}}, {"topology_id": {"context_id": {"context_uuid": {"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"}}, "topology_uuid": {"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"}}, "device_id": {"device_uuid": {"uuid": "012c4e67-0024-5f30-b527-55ec6daf2639"}}, "endpoint_uuid": {"uuid": "c4b8eb66-2fcf-5f66-802f-6cd9590fe70b"}}]}, {"name": "R1-T1.1", "optical_details": {"src_port": "port-33-out", "dst_port": "1", "local_peer_port": "port-33-in", "remote_peer_port": "1", "c_slots": {"1": 1, "2": 1, "3": 1, "4": 1, "5": 1, "6": 1, "7": 1, "8": 1, "9": 1, "10": 1, "11": 1, "12": 1, "13": 1, "14": 1, "15": 1, "16": 1, "17": 1, "18": 1, "19": 1, "20": 1, "21": 1, "22": 1, "23": 1, "24": 1, "25": 1, "26": 1, "27": 1, "28": 1, "29": 1, "30": 1}, "l_slots": {"101": 1, "102": 1, "103": 1, "104": 1, "105": 1, "106": 1, "107": 1, "108": 1, "109": 1, "110": 1, "111": 1, "112": 1, "113": 1, "114": 1, "115": 1, "116": 1, "117": 1, "118": 1, "119": 1, "120": 1}, "s_slots": {"501": 1, "502": 1, "503": 1, "504": 1, "505": 1, "506": 1, "507": 1, "508": 1, "509": 1, "510": 1, "511": 1, "512": 1, "513": 1, "514": 1, "515": 1, "516": 1, "517": 1, "518": 1, "519": 1, "520": 1}}, "link_id": {"link_uuid": {"uuid": "63c6a257-f171-59f8-b1e8-e3c4086ba36a"}}, "link_endpoint_ids": [{"topology_id": {"context_id": {"context_uuid": {"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"}}, "topology_uuid": {"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"}}, "device_id": {"device_uuid": {"uuid": "4dbdc2d8-cbde-5e48-a3c0-5161387a58c7"}}, "endpoint_uuid": {"uuid": "5eb4f156-7811-53f3-9172-8402127cf7b9"}}, {"topology_id": {"context_id": {"context_uuid": {"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"}}, "topology_uuid": {"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"}}, "device_id": {"device_uuid": {"uuid": "68741528-2e94-5274-ab3c-fddcd8dc05ef"}}, "endpoint_uuid": {"uuid": "cd539095-12a6-5460-8b07-481ec1901c9a"}}]}, {"name": "T1.2-R1", "optical_details": {"src_port": "2", "dst_port": "port-34-in", "local_peer_port": "2", "remote_peer_port": "port-34-out", "c_slots": {"1": 1, "2": 1, "3": 1, "4": 1, "5": 1, "6": 1, "7": 1, "8": 1, "9": 0, "10": 0, "11": 0, "12": 0, "13": 0, "14": 0, "15": 0, "16": 0, "17": 1, "18": 1, "19": 1, "20": 1, "21": 1, "22": 1, "23": 1, "24": 1, "25": 1, "26": 1, "27": 1, "28": 1, "29": 1, "30": 1}, "l_slots": {"101": 1, "102": 1, "103": 1, "104": 1, "105": 1, "106": 1, "107": 1, "108": 1, "109": 1, "110": 1, "111": 1, "112": 1, "113": 1, "114": 1, "115": 1, "116": 1, "117": 1, "118": 1, "119": 1, "120": 1}, "s_slots": {"501": 1, "502": 1, "503": 1, "504": 1, "505": 1, "506": 1, "507": 1, "508": 1, "509": 1, "510": 1, "511": 1, "512": 1, "513": 1, "514": 1, "515": 1, "516": 1, "517": 1, "518": 1, "519": 1, "520": 1}}, "link_id": {"link_uuid": {"uuid": "817a2fcb-5dfd-55a6-b669-a141014cc38d"}}, "link_endpoint_ids": [{"topology_id": {"context_id": {"context_uuid": {"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"}}, "topology_uuid": {"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"}}, "device_id": {"device_uuid": {"uuid": "27c2ed23-e74a-518f-820d-ae2c8ae23086"}}, "endpoint_uuid": {"uuid": "7dc65d0e-af57-5d3c-9ba6-f6ec81a354c6"}}, {"topology_id": {"context_id": {"context_uuid": {"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"}}, "topology_uuid": {"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"}}, "device_id": {"device_uuid": {"uuid": "68741528-2e94-5274-ab3c-fddcd8dc05ef"}}, "endpoint_uuid": {"uuid": "904c4b18-10a6-512b-9bb2-8ec81e74fda4"}}]}, {"name": "T2.2-R2", "optical_details": {"src_port": "2", "dst_port": "port-34-in", "local_peer_port": "2", "remote_peer_port": "port-34-out", "c_slots": {"1": 1, "2": 1, "3": 1, "4": 1, "5": 1, "6": 1, "7": 1, "8": 1, "9": 1, "10": 1, "11": 1, "12": 1, "13": 1, "14": 1, "15": 1, "16": 1, "17": 1, "18": 1, "19": 1, "20": 1, "21": 1, "22": 1, "23": 1, "24": 1, "25": 1, "26": 1, "27": 1, "28": 1, "29": 1, "30": 1}, "l_slots": {"101": 1, "102": 1, "103": 1, "104": 1, "105": 1, "106": 1, "107": 1, "108": 1, "109": 1, "110": 1, "111": 1, "112": 1, "113": 1, "114": 1, "115": 1, "116": 1, "117": 1, "118": 1, "119": 1, "120": 1}, "s_slots": {"501": 1, "502": 1, "503": 1, "504": 1, "505": 1, "506": 1, "507": 1, "508": 1, "509": 1, "510": 1, "511": 1, "512": 1, "513": 1, "514": 1, "515": 1, "516": 1, "517": 1, "518": 1, "519": 1, "520": 1}}, "link_id": {"link_uuid": {"uuid": "884c6c6a-ad1b-5228-a48f-e9db4bc174df"}}, "link_endpoint_ids": [{"topology_id": {"context_id": {"context_uuid": {"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"}}, "topology_uuid": {"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"}}, "device_id": {"device_uuid": {"uuid": "c944aaeb-bbdf-5f2d-b31c-8cc8903045b6"}}, "endpoint_uuid": {"uuid": "6e9b83ef-b9a4-5898-9495-38c45635aac7"}}, {"topology_id": {"context_id": {"context_uuid": {"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"}}, "topology_uuid": {"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"}}, "device_id": {"device_uuid": {"uuid": "012c4e67-0024-5f30-b527-55ec6daf2639"}}, "endpoint_uuid": {"uuid": "c4b8eb66-2fcf-5f66-802f-6cd9590fe70b"}}]}, {"name": "R1-T1.3", "optical_details": {"src_port": "port-35-out", "dst_port": "3", "local_peer_port": "port-35-in", "remote_peer_port": "3", "c_slots": {"1": 1, "2": 1, "3": 1, "4": 1, "5": 1, "6": 1, "7": 1, "8": 1, "9": 1, "10": 1, "11": 1, "12": 1, "13": 1, "14": 1, "15": 1, "16": 1, "17": 1, "18": 1, "19": 1, "20": 1, "21": 1, "22": 1, "23": 1, "24": 1, "25": 1, "26": 1, "27": 1, "28": 1, "29": 1, "30": 1}, "l_slots": {"101": 1, "102": 1, "103": 1, "104": 1, "105": 1, "106": 1, "107": 1, "108": 1, "109": 1, "110": 1, "111": 1, "112": 1, "113": 1, "114": 1, "115": 1, "116": 1, "117": 1, "118": 1, "119": 1, "120": 1}, "s_slots": {"501": 1, "502": 1, "503": 1, "504": 1, "505": 1, "506": 1, "507": 1, "508": 1, "509": 1, "510": 1, "511": 1, "512": 1, "513": 1, "514": 1, "515": 1, "516": 1, "517": 1, "518": 1, "519": 1, "520": 1}}, "link_id": {"link_uuid": {"uuid": "89e3a6c6-d613-55bf-925c-c817ee24a133"}}, "link_endpoint_ids": [{"topology_id": {"context_id": {"context_uuid": {"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"}}, "topology_uuid": {"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"}}, "device_id": {"device_uuid": {"uuid": "68741528-2e94-5274-ab3c-fddcd8dc05ef"}}, "endpoint_uuid": {"uuid": "b9fbeed8-e304-5bd5-90e1-3e43c6af5a16"}}, {"topology_id": {"context_id": {"context_uuid": {"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"}}, "topology_uuid": {"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"}}, "device_id": {"device_uuid": {"uuid": "cf618e18-c0a1-58c4-9827-943a2c0523d6"}}, "endpoint_uuid": {"uuid": "bbdfc5ef-4f8b-5921-9d1f-33dd9a5f18c8"}}]}, {"name": "R1-T1.2", "optical_details": {"src_port": "port-34-out", "dst_port": "2", "local_peer_port": "port-34-in", "remote_peer_port": "2", "c_slots": {"1": 1, "2": 1, "3": 1, "4": 1, "5": 1, "6": 1, "7": 1, "8": 1, "9": 1, "10": 1, "11": 1, "12": 1, "13": 1, "14": 1, "15": 1, "16": 1, "17": 1, "18": 1, "19": 1, "20": 1, "21": 1, "22": 1, "23": 1, "24": 1, "25": 1, "26": 1, "27": 1, "28": 1, "29": 1, "30": 1}, "l_slots": {"101": 1, "102": 1, "103": 1, "104": 1, "105": 1, "106": 1, "107": 1, "108": 1, "109": 1, "110": 1, "111": 1, "112": 1, "113": 1, "114": 1, "115": 1, "116": 1, "117": 1, "118": 1, "119": 1, "120": 1}, "s_slots": {"501": 1, "502": 1, "503": 1, "504": 1, "505": 1, "506": 1, "507": 1, "508": 1, "509": 1, "510": 1, "511": 1, "512": 1, "513": 1, "514": 1, "515": 1, "516": 1, "517": 1, "518": 1, "519": 1, "520": 1}}, "link_id": {"link_uuid": {"uuid": "b11e2e7b-ef00-5c11-9dc6-5fd34bd11f6e"}}, "link_endpoint_ids": [{"topology_id": {"context_id": {"context_uuid": {"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"}}, "topology_uuid": {"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"}}, "device_id": {"device_uuid": {"uuid": "68741528-2e94-5274-ab3c-fddcd8dc05ef"}}, "endpoint_uuid": {"uuid": "12b4419f-9ae9-5839-ad52-9684b1f30878"}}, {"topology_id": {"context_id": {"context_uuid": {"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"}}, "topology_uuid": {"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"}}, "device_id": {"device_uuid": {"uuid": "27c2ed23-e74a-518f-820d-ae2c8ae23086"}}, "endpoint_uuid": {"uuid": "7dc65d0e-af57-5d3c-9ba6-f6ec81a354c6"}}]}, {"name": "T2.3-R2", "optical_details": {"src_port": "3", "dst_port": "port-35-in", "local_peer_port": "3", "remote_peer_port": "port-35-out", "c_slots": {"1": 1, "2": 1, "3": 1, "4": 1, "5": 1, "6": 1, "7": 1, "8": 1, "9": 1, "10": 1, "11": 1, "12": 1, "13": 1, "14": 1, "15": 1, "16": 1, "17": 1, "18": 1, "19": 1, "20": 1, "21": 1, "22": 1, "23": 1, "24": 1, "25": 1, "26": 1, "27": 1, "28": 1, "29": 1, "30": 1}, "l_slots": {"101": 1, "102": 1, "103": 1, "104": 1, "105": 1, "106": 1, "107": 1, "108": 1, "109": 1, "110": 1, "111": 1, "112": 1, "113": 1, "114": 1, "115": 1, "116": 1, "117": 1, "118": 1, "119": 1, "120": 1}, "s_slots": {"501": 1, "502": 1, "503": 1, "504": 1, "505": 1, "506": 1, "507": 1, "508": 1, "509": 1, "510": 1, "511": 1, "512": 1, "513": 1, "514": 1, "515": 1, "516": 1, "517": 1, "518": 1, "519": 1, "520": 1}}, "link_id": {"link_uuid": {"uuid": "be7afc05-6e45-5899-896b-b331d6ab65c8"}}, "link_endpoint_ids": [{"topology_id": {"context_id": {"context_uuid": {"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"}}, "topology_uuid": {"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"}}, "device_id": {"device_uuid": {"uuid": "c944aaeb-bbdf-5f2d-b31c-8cc8903045b6"}}, "endpoint_uuid": {"uuid": "5cfa4f91-cbce-5721-b612-e6b5eaa76721"}}, {"topology_id": {"context_id": {"context_uuid": {"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"}}, "topology_uuid": {"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"}}, "device_id": {"device_uuid": {"uuid": "ce0cdfdd-2182-5027-8177-676ca3244f9d"}}, "endpoint_uuid": {"uuid": "b1acaee3-904d-5106-ac3d-5ae6c42b5333"}}]}, {"name": "R2-T2.3", "optical_details": {"src_port": "port-35-out", "dst_port": "3", "local_peer_port": "port-35-in", "remote_peer_port": "3", "c_slots": {"1": 1, "2": 1, "3": 1, "4": 1, "5": 1, "6": 1, "7": 1, "8": 1, "9": 1, "10": 1, "11": 1, "12": 1, "13": 1, "14": 1, "15": 1, "16": 1, "17": 1, "18": 1, "19": 1, "20": 1, "21": 1, "22": 1, "23": 1, "24": 1, "25": 1, "26": 1, "27": 1, "28": 1, "29": 1, "30": 1}, "l_slots": {"101": 1, "102": 1, "103": 1, "104": 1, "105": 1, "106": 1, "107": 1, "108": 1, "109": 1, "110": 1, "111": 1, "112": 1, "113": 1, "114": 1, "115": 1, "116": 1, "117": 1, "118": 1, "119": 1, "120": 1}, "s_slots": {"501": 1, "502": 1, "503": 1, "504": 1, "505": 1, "506": 1, "507": 1, "508": 1, "509": 1, "510": 1, "511": 1, "512": 1, "513": 1, "514": 1, "515": 1, "516": 1, "517": 1, "518": 1, "519": 1, "520": 1}}, "link_id": {"link_uuid": {"uuid": "d4e89764-11c5-5f59-b7d6-a3aa2dab43df"}}, "link_endpoint_ids": [{"topology_id": {"context_id": {"context_uuid": {"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"}}, "topology_uuid": {"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"}}, "device_id": {"device_uuid": {"uuid": "c944aaeb-bbdf-5f2d-b31c-8cc8903045b6"}}, "endpoint_uuid": {"uuid": "261a53b4-d257-5f35-bf5b-b2f975d7d2ed"}}, {"topology_id": {"context_id": {"context_uuid": {"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"}}, "topology_uuid": {"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"}}, "device_id": {"device_uuid": {"uuid": "ce0cdfdd-2182-5027-8177-676ca3244f9d"}}, "endpoint_uuid": {"uuid": "b1acaee3-904d-5106-ac3d-5ae6c42b5333"}}]}, {"name": "R1-R2", "optical_details": {"src_port": "port-1-out", "dst_port": "port-1-in", "local_peer_port": "port-1-in", "remote_peer_port": "port-1-out", "c_slots": {"1": 0, "2": 0, "3": 0, "4": 0, "5": 0, "6": 0, "7": 0, "8": 0, "9": 0, "10": 0, "11": 0, "12": 0, "13": 0, "14": 0, "15": 0, "16": 0, "17": 1, "18": 1, "19": 1, "20": 1, "21": 1, "22": 1, "23": 1, "24": 1, "25": 1, "26": 1, "27": 1, "28": 1, "29": 1, "30": 1}, "l_slots": {"101": 1, "102": 1, "103": 1, "104": 1, "105": 1, "106": 1, "107": 1, "108": 1, "109": 1, "110": 1, "111": 1, "112": 1, "113": 1, "114": 1, "115": 1, "116": 1, "117": 1, "118": 1, "119": 1, "120": 1}, "s_slots": {"501": 1, "502": 1, "503": 1, "504": 1, "505": 1, "506": 1, "507": 1, "508": 1, "509": 1, "510": 1, "511": 1, "512": 1, "513": 1, "514": 1, "515": 1, "516": 1, "517": 1, "518": 1, "519": 1, "520": 1}}, "link_id": {"link_uuid": {"uuid": "e273644c-0dfa-5053-8850-0722995e7ba3"}}, "link_endpoint_ids": [{"topology_id": {"context_id": {"context_uuid": {"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"}}, "topology_uuid": {"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"}}, "device_id": {"device_uuid": {"uuid": "68741528-2e94-5274-ab3c-fddcd8dc05ef"}}, "endpoint_uuid": {"uuid": "77df46fd-6d6e-5726-9960-ca439c925dea"}}, {"topology_id": {"context_id": {"context_uuid": {"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"}}, "topology_uuid": {"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"}}, "device_id": {"device_uuid": {"uuid": "c944aaeb-bbdf-5f2d-b31c-8cc8903045b6"}}, "endpoint_uuid": {"uuid": "bcfb768c-e8fb-5e0b-9559-821d120b5410"}}]}, {"name": "T1.1-R1", "optical_details": {"src_port": "1", "dst_port": "port-33-in", "local_peer_port": "1", "remote_peer_port": "port-33-out", "c_slots": {"1": 0, "2": 0, "3": 0, "4": 0, "5": 0, "6": 0, "7": 0, "8": 0, "9": 1, "10": 1, "11": 1, "12": 1, "13": 1, "14": 1, "15": 1, "16": 1, "17": 1, "18": 1, "19": 1, "20": 1, "21": 1, "22": 1, "23": 1, "24": 1, "25": 1, "26": 1, "27": 1, "28": 1, "29": 1, "30": 1, "31": 1, "32": 1, "33": 1, "34": 1, "35": 1}, "l_slots": {"101": 1, "102": 1, "103": 1, "104": 1, "105": 1, "106": 1, "107": 1, "108": 1, "109": 1, "110": 1, "111": 1, "112": 1, "113": 1, "114": 1, "115": 1, "116": 1, "117": 1, "118": 1, "119": 1, "120": 1}, "s_slots": {"501": 1, "502": 1, "503": 1, "504": 1, "505": 1, "506": 1, "507": 1, "508": 1, "509": 1, "510": 1, "511": 1, "512": 1, "513": 1, "514": 1, "515": 1, "516": 1, "517": 1, "518": 1, "519": 1, "520": 1}}, "link_id": {"link_uuid": {"uuid": "e8bd9082-ebad-55b8-b110-7c21fddaf1cf"}}, "link_endpoint_ids": [{"topology_id": {"context_id": {"context_uuid": {"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"}}, "topology_uuid": {"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"}}, "device_id": {"device_uuid": {"uuid": "68741528-2e94-5274-ab3c-fddcd8dc05ef"}}, "endpoint_uuid": {"uuid": "0b1c4d0e-5140-5085-ab66-2def390b650f"}}, {"topology_id": {"context_id": {"context_uuid": {"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"}}, "topology_uuid": {"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"}}, "device_id": {"device_uuid": {"uuid": "4dbdc2d8-cbde-5e48-a3c0-5161387a58c7"}}, "endpoint_uuid": {"uuid": "5eb4f156-7811-53f3-9172-8402127cf7b9"}}]}, {"name": "R2-R1", "optical_details": {"src_port": "port-1-out", "dst_port": "port-1-in", "local_peer_port": "port-1-in", "remote_peer_port": "port-1-out", "c_slots": {"1": 1, "2": 1, "3": 1, "4": 1, "5": 1, "6": 1, "7": 1, "8": 1, "9": 1, "10": 1, "11": 1, "12": 1, "13": 1, "14": 1, "15": 1, "16": 1, "17": 1, "18": 1, "19": 1, "20": 1, "21": 1, "22": 1, "23": 1, "24": 1, "25": 1, "26": 1, "27": 1, "28": 1, "29": 1, "30": 1}, "l_slots": {"101": 1, "102": 1, "103": 1, "104": 1, "105": 1, "106": 1, "107": 1, "108": 1, "109": 1, "110": 1, "111": 1, "112": 1, "113": 1, "114": 1, "115": 1, "116": 1, "117": 1, "118": 1, "119": 1, "120": 1}, "s_slots": {"501": 1, "502": 1, "503": 1, "504": 1, "505": 1, "506": 1, "507": 1, "508": 1, "509": 1, "510": 1, "511": 1, "512": 1, "513": 1, "514": 1, "515": 1, "516": 1, "517": 1, "518": 1, "519": 1, "520": 1}}, "link_id": {"link_uuid": {"uuid": "eae23f48-40de-5aae-b3d1-fa3cda231678"}}, "link_endpoint_ids": [{"topology_id": {"context_id": {"context_uuid": {"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"}}, "topology_uuid": {"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"}}, "device_id": {"device_uuid": {"uuid": "c944aaeb-bbdf-5f2d-b31c-8cc8903045b6"}}, "endpoint_uuid": {"uuid": "3efedbc2-7363-53cf-a0b9-fc4a2bcbd245"}}, {"topology_id": {"context_id": {"context_uuid": {"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"}}, "topology_uuid": {"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"}}, "device_id": {"device_uuid": {"uuid": "68741528-2e94-5274-ab3c-fddcd8dc05ef"}}, "endpoint_uuid": {"uuid": "436bb32a-c8a0-5718-bbdb-382c79d96587"}}]}, {"name": "T2.1-R2", "optical_details": {"src_port": "1", "dst_port": "port-33-in", "local_peer_port": "1", "remote_peer_port": "port-33-out", "c_slots": {"1": 1, "2": 1, "3": 1, "4": 1, "5": 1, "6": 1, "7": 1, "8": 1, "9": 1, "10": 1, "11": 1, "12": 1, "13": 1, "14": 1, "15": 1, "16": 1, "17": 1, "18": 1, "19": 1, "20": 1, "21": 1, "22": 1, "23": 1, "24": 1, "25": 1, "26": 1, "27": 1, "28": 1, "29": 1, "30": 1}, "l_slots": {"101": 1, "102": 1, "103": 1, "104": 1, "105": 1, "106": 1, "107": 1, "108": 1, "109": 1, "110": 1, "111": 1, "112": 1, "113": 1, "114": 1, "115": 1, "116": 1, "117": 1, "118": 1, "119": 1, "120": 1}, "s_slots": {"501": 1, "502": 1, "503": 1, "504": 1, "505": 1, "506": 1, "507": 1, "508": 1, "509": 1, "510": 1, "511": 1, "512": 1, "513": 1, "514": 1, "515": 1, "516": 1, "517": 1, "518": 1, "519": 1, "520": 1}}, "link_id": {"link_uuid": {"uuid": "ebb2ca0f-d4c1-51c4-ab41-dceea90f811f"}}, "link_endpoint_ids": [{"topology_id": {"context_id": {"context_uuid": {"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"}}, "topology_uuid": {"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"}}, "device_id": {"device_uuid": {"uuid": "87d74166-65e3-595e-b643-122b4fd0303f"}}, "endpoint_uuid": {"uuid": "2a307a8e-d326-5ea2-9437-b0320fb4c2a6"}}, {"topology_id": {"context_id": {"context_uuid": {"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"}}, "topology_uuid": {"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"}}, "device_id": {"device_uuid": {"uuid": "c944aaeb-bbdf-5f2d-b31c-8cc8903045b6"}}, "endpoint_uuid": {"uuid": "be1b3bb0-8aed-569a-be91-e888b0c0985d"}}]}, {"name": "T1.3-R1", "optical_details": {"src_port": "3", "dst_port": "port-35-in", "local_peer_port": "3", "remote_peer_port": "port-35-out", "c_slots": {"1": 1, "2": 1, "3": 1, "4": 1, "5": 1, "6": 1, "7": 1, "8": 1, "9": 1, "10": 1, "11": 1, "12": 1, "13": 1, "14": 1, "15": 1, "16": 1, "17": 1, "18": 1, "19": 1, "20": 1, "21": 1, "22": 1, "23": 1, "24": 1, "25": 1, "26": 1, "27": 1, "28": 1, "29": 1, "30": 1}, "l_slots": {"101": 1, "102": 1, "103": 1, "104": 1, "105": 1, "106": 1, "107": 1, "108": 1, "109": 1, "110": 1, "111": 1, "112": 1, "113": 1, "114": 1, "115": 1, "116": 1, "117": 1, "118": 1, "119": 1, "120": 1}, "s_slots": {"501": 1, "502": 1, "503": 1, "504": 1, "505": 1, "506": 1, "507": 1, "508": 1, "509": 1, "510": 1, "511": 1, "512": 1, "513": 1, "514": 1, "515": 1, "516": 1, "517": 1, "518": 1, "519": 1, "520": 1}}, "link_id": {"link_uuid": {"uuid": "f79a817c-a6a0-55d5-9398-a582a9835be9"}}, "link_endpoint_ids": [{"topology_id": {"context_id": {"context_uuid": {"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"}}, "topology_uuid": {"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"}}, "device_id": {"device_uuid": {"uuid": "68741528-2e94-5274-ab3c-fddcd8dc05ef"}}, "endpoint_uuid": {"uuid": "435a198b-cd6f-5d29-a72d-ea4f04cb658a"}}, {"topology_id": {"context_id": {"context_uuid": {"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"}}, "topology_uuid": {"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"}}, "device_id": {"device_uuid": {"uuid": "cf618e18-c0a1-58c4-9827-943a2c0523d6"}}, "endpoint_uuid": {"uuid": "bbdfc5ef-4f8b-5921-9d1f-33dd9a5f18c8"}}]}]}
diff --git a/src/opticalcontroller/RSA.py b/src/opticalcontroller/RSA.py
index 0401c2535..57a967ead 100644
--- a/src/opticalcontroller/RSA.py
+++ b/src/opticalcontroller/RSA.py
@@ -328,6 +328,8 @@ class RSA():
         path = flow["path"]
         links = flow["links"]
         bidir = flow["bidir"]
+        flow_id = flow["flow_id"]
+
        
         for l in links:
             if debug:
@@ -357,6 +359,10 @@ class RSA():
                 print("restoring OB")
             print(f"invoking restore_optical_band o_b_id: {o_b_id} , slots {slots} , band {band} ")    
             self.restore_optical_band(o_b_id, slots, band)
+            if flow_id in self.optical_bands[o_b_id]["served_lightpaths"]:
+                if flow_id in self.optical_bands[o_b_id]["served_lightpaths"]:
+                    self.optical_bands[o_b_id]["served_lightpaths"].remove(flow_id)
+
             #self.restore_optical_band_2(o_b_id, slots, band,links)
         if bidir:
             for l in links:
@@ -395,6 +401,9 @@ class RSA():
     def del_band(self, flow,flow_id, o_b_id = None):
         
         print(f"delete band {flow} ")
+        
+        if len(self.optical_bands[o_b_id]["served_lightpaths"])>0:
+            return False
         flows = flow["flows"]
         band = None
         slots = flow["slots"]
@@ -425,8 +434,6 @@ class RSA():
             print(f"invoking restore_link_2 fib: {fib} , slots {slots} , band {band} ")
             self.restore_link(fib, slots, band)
             self.optical_bands[o_b_id]["is_active"]=False
-            if flow_id in self.optical_bands[o_b_id]["served_lightpaths"]:
-                       self.optical_bands[o_b_id]["served_lightpaths"].remove(flow_id)
             if debug:
                 print(fib[band])
             
-- 
GitLab