Commit 43c6e7a9 authored by Andrea Sgambelluri's avatar Andrea Sgambelluri
Browse files

BIDIR Bugs Fixed

parent 0cd1a983
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -180,7 +180,7 @@ def edit_config(
                str_config_messages=delete_optical_band(resources)
            else :
                str_config_messages=disable_media_channel(resources)

        logger.info(f"messages ,{str_config_messages} ")
        for str_config_message in str_config_messages:  
            # configuration of the received templates 
            if str_config_message is None: raise UnsupportedResourceKeyException("CONFIG")
+4 −1
Original line number Diff line number Diff line
@@ -98,7 +98,8 @@ class OCServiceHandler(_ServiceHandler):
            if not is_opticalband: 
                LOGGER.info(f"ob-expanded bvalue is: {ob_expansion} and is_opticalband {is_opticalband}")
                return results
        
        LOGGER.info(f"is_opticalband {is_opticalband}")    
        LOGGER.info(f"set_Opticalconfig_endpoints is:{endpoints}")
        flows = endpoints_to_flows(endpoints, bidir, is_opticalband)
        
        #new cycle for setting optical devices
@@ -166,6 +167,8 @@ class OCServiceHandler(_ServiceHandler):
        if is_openroadm:
            flows = convert_or_endpoints_to_flows(endpoints, bidir)
        else:
            LOGGER.info(f"is_opticalband {is_opticalband}")    
            LOGGER.info(f'RERF endpoints :{endpoints}')
            flows = endpoints_to_flows(endpoints, bidir, is_opticalband)
            LOGGER.info(f'RERF:{flows}')

+11 −4
Original line number Diff line number Diff line
@@ -302,8 +302,15 @@ def conn_flows(endpoints : List[Tuple[str, str, Optional[str]]], bidir : int):
    #if bidir reading 4 endpoints per node
    if bidir:
        log.info(f"i starts with {i} ")
        device0 , endpoint0=endpoints[0][0:2]
        device1 , endpoint1=endpoints[1][0:2]
        finalend=end-2
        if device0 ==device1:
           i = i + 1
        while(i < end-2):
           
        else  :
            finalend=end-1   
        while(i < finalend):
            #i
            endpoint = endpoints[i]
            device_uuid, endpoint_uuid = endpoint[0:2]
@@ -317,7 +324,7 @@ def conn_flows(endpoints : List[Tuple[str, str, Optional[str]]], bidir : int):
                entry_tuple = endpoint_uuid, next_endpoint_uuid
                entries[device_uuid].append(entry_tuple)
            else:

                log.info(f"error : next_dev {next_device_uuid} dev {device_uuid} for i {i} ")
                return {} 
            #i+2
            
@@ -333,7 +340,7 @@ def conn_flows(endpoints : List[Tuple[str, str, Optional[str]]], bidir : int):
                entries[device_uuid].append(entry_tuple)
                i = i + 4
            else:

                log.info(f"error : next_2_dev {next_2_device_uuid} next_3_device{next_3_device_uuid} dev {device_uuid} for i {i} ")
                return {}
    else:
        while(i < end-1):
+1 −0
Original line number Diff line number Diff line
@@ -148,6 +148,7 @@ class TaskExecutor:
        self, device : Device, settings : str, flows : list, is_opticalband : bool,
        connection_uuid:str
    ):
        LOGGER.info(f"service optical config {settings}")
        device_key = get_device_key(device.device_id)
        optical_config_id = OpticalConfigId()
        optical_config_id.opticalconfig_uuid = opticalconfig_get_uuid(device.device_id)