Commit 20fd29c4 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Service - L3 VPN gNMI OpenConfig Service Handler:

- Extended IP address setting recognition
parent 8b8e75b8
Loading
Loading
Loading
Loading
+17 −2
Original line number Diff line number Diff line
@@ -85,8 +85,23 @@ class EndpointComposer:
            self.objekt = endpoint_obj
        if settings is None: return
        json_settings : Dict = settings.value

        if 'address_ip' in json_settings:
            self.ipv4_address = json_settings['address_ip']
        elif 'ip_address' in json_settings:
            self.ipv4_address = json_settings['ip_address']
        else:
            MSG = 'IP Address not found. Tried: address_ip and ip_address. endpoint_obj={:s} settings={:s}'
            LOGGER.warning(MSG.format(str(endpoint_obj), str(settings)))

        if 'address_prefix' in json_settings:
            self.ipv4_prefix_len = json_settings['address_prefix']
        elif 'prefix_length' in json_settings:
            self.ipv4_prefix_len = json_settings['prefix_length']
        else:
            MSG = 'IP Address Prefix not found. Tried: address_prefix and prefix_length. endpoint_obj={:s} settings={:s}'
            LOGGER.warning(MSG.format(str(endpoint_obj), str(settings)))

        self.sub_interface_index = json_settings.get('index', 0)

    def get_config_rules(self, network_instance_name : str, delete : bool = False) -> List[Dict]: