Commit 62484a77 authored by Mohammad Ismaeel's avatar Mohammad Ismaeel
Browse files

Separated Configs for Media Channels

parent 188b2586
Loading
Loading
Loading
Loading
+41 −41
Original line number Diff line number Diff line
@@ -137,14 +137,14 @@ def create_media_channel_v2 (resources):

    config,ports,index=filter_config(resources,unwanted_keys)

    n = 0
    for flow in ports:
        doc, tag, text = Doc().tagtext()

        with tag('config',xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"):
            with tag('wavelength-router', xmlns="http://openconfig.net/yang/wavelength-router"):
                    with tag('media-channels'):
                    n = 0
                        
                    for flow in ports:
                    
                            src,dest=flow
                            with tag('channel', operation="create"):
                            #with tag('channel'):
+9 −7
Original line number Diff line number Diff line
@@ -236,10 +236,10 @@ def conn_flows(endpoints : List[Tuple[str, str, Optional[str]]], bidir : int):
        entries[device_uuid] = []
    entry_tuple = "0", endpoint_uuid
    entries[device_uuid].append(entry_tuple)
    i = i + 1
    i = i + 2
    #if bidir reading 4 endpoints per node
    if bidir:
        while(i < end-1):
        while(i < end-2):
            #i
            endpoint = endpoints[i]
            device_uuid, endpoint_uuid = endpoint[0:2]
@@ -253,10 +253,11 @@ 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("ERROR in bidirectional ob")
                log.debug("{}, {}, {}".format(i, next_device_uuid, device_uuid))
                log.info(f"ERROR1 in bidirectional connection ")
                log.info("{}, {}, {}".format(i+2, next_device_uuid, device_uuid))
                return {} 
            #i+2
            
            next_2_endpoint = endpoints[i+2]
            next_2_device_uuid, next_2_endpoint_uuid = next_2_endpoint[0:2]                    
            #i+3
@@ -267,7 +268,8 @@ def conn_flows(endpoints : List[Tuple[str, str, Optional[str]]], bidir : int):
                entries[device_uuid].append(entry_tuple)
                i = i + 4
            else:
                log.info("ERROR in bidirection ob")
                log.info("ERROR2 in bidirection connection")
                log.info("{}, {}, {}".format(i+4, next_2_device_uuid, device_uuid))
                return {}
    else:
        while(i < end-1):
@@ -285,8 +287,8 @@ def conn_flows(endpoints : List[Tuple[str, str, Optional[str]]], bidir : int):
                entries[device_uuid].append(entry_tuple)
                i = i + 2
            else:
                log.debug("ERROR in bidirectional ob")
                log.debug("{}, {}, {}".format(i, next_device_uuid, device_uuid))
                log.info("ERROR3 in bidirectional ob")
                log.info("{}, {}, {}".format(i, next_device_uuid, device_uuid))
                return {}
    #rx tp            
    endpoint = endpoints[i]