Skip to content
Snippets Groups Projects
Commit eac09e4f authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Debug OFC24, Service and Optical Controller

parent d89f0667
No related branches found
No related tags found
2 merge requests!294Release TeraFlowSDN 4.0,!285Resolve: "(CNIT) New SBI Driver based on OpenROADM for ROADMs"
...@@ -219,13 +219,22 @@ class TaskExecutor: ...@@ -219,13 +219,22 @@ class TaskExecutor:
service = item service = item
if (isinstance(item, ServiceId)): if (isinstance(item, ServiceId)):
service = self.get_service(item) service = self.get_service(item)
class_service_handler = None service_handler = None
service_handler_settings = {} service_handler_settings = {}
for connection in connections.connections: for connection in connections.connections:
connection_uuid=connection.connection_id.connection_uuid connection_uuid=connection.connection_id.connection_uuid
if class_service_handler is None: if service_handler is None:
class_service_handler = self.get_service_handler(connection, service,**service_handler_settings) service_handlers = self.get_service_handlers(
if class_service_handler.check_media_channel(connection_uuid): connection, service, **service_handler_settings
)
# TODO: improve to select different service handlers when needed
# By now, assume a single service handler is retrieved for all the
# device types in the path, i.e., all entries carry the same
# service handler, so we choose the first one retrieved.
if len(service_handlers) < 1:
raise Exception('Unsupported case: {:s}'.format(str(service_handlers)))
service_handler,_ = list(service_handlers.values())[0]
if service_handler.check_media_channel(connection_uuid):
return True return True
return False return False
...@@ -234,7 +243,16 @@ class TaskExecutor: ...@@ -234,7 +243,16 @@ class TaskExecutor:
) -> bool: ) -> bool:
service_handler_settings = {} service_handler_settings = {}
connection_uuid = connection.connection_id.connection_uuid connection_uuid = connection.connection_id.connection_uuid
service_handler_class = self.get_service_handler(connection, service, **service_handler_settings) classes_service_handlers = self.get_service_handlers(
connection, service, **service_handler_settings
)
# TODO: improve to select different service handlers when needed
# By now, assume a single service handler is retrieved for all the
# device types in the path, i.e., all entries carry the same
# service handler, so we choose the first one retrieved.
if len(classes_service_handlers) < 1:
raise Exception('Unsupported case: {:s}'.format(str(classes_service_handlers)))
service_handler_class,_ = list(classes_service_handlers.values())[0]
return service_handler_class.check_media_channel(connection_uuid) return service_handler_class.check_media_channel(connection_uuid)
def get_device_controller(self, device : Device) -> Optional[Device]: def get_device_controller(self, device : Device) -> Optional[Device]:
......
...@@ -48,7 +48,16 @@ class Task_OpticalConnectionDeconfigure(_Task): ...@@ -48,7 +48,16 @@ class Task_OpticalConnectionDeconfigure(_Task):
service = self._task_executor.get_service(connection.service_id) service = self._task_executor.get_service(connection.service_id)
errors = [] errors = []
service_handler_settings = {} service_handler_settings = {}
service_handler = self._task_executor.get_service_handler(connection, service, **service_handler_settings) service_handlers = self._task_executor.get_service_handlers(
connection, service, **service_handler_settings
)
# TODO: improve to select different service handlers when needed
# By now, assume a single service handler is retrieved for all the
# device types in the path, i.e., all entries carry the same
# service handler, so we choose the first one retrieved.
if len(service_handlers) < 1:
raise Exception('Unsupported case: {:s}'.format(str(service_handlers)))
service_handler,_ = list(service_handlers.values())[0]
endpointids_to_delete = endpointids_to_raw(connection.path_hops_endpoint_ids) endpointids_to_delete = endpointids_to_raw(connection.path_hops_endpoint_ids)
connection_uuid = connection.connection_id.connection_uuid.uuid connection_uuid = connection.connection_id.connection_uuid.uuid
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment