From d5b5b8c9834431404efca7448b458accc99e4d77 Mon Sep 17 00:00:00 2001 From: velazquez Date: Wed, 15 Jul 2026 10:34:47 +0000 Subject: [PATCH] Refactor process_site_network_access to remove checks for site-network-access-type and access-role allowing others than multipoint and hub/spoke roles --- src/nbi/service/ietf_l3vpn/Handlers.py | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/nbi/service/ietf_l3vpn/Handlers.py b/src/nbi/service/ietf_l3vpn/Handlers.py index 9e5162df2..59d0ec383 100644 --- a/src/nbi/service/ietf_l3vpn/Handlers.py +++ b/src/nbi/service/ietf_l3vpn/Handlers.py @@ -114,23 +114,9 @@ def process_site_network_access( site_id : str, network_access : Dict, site_static_routing : Dict[Tuple[str, int, int], str], errors : List[Dict] ) -> None: endpoint_uuid = network_access['site-network-access-id'] - - if 'ietf-l3vpn-svc' in network_access['site-network-access-type']: - # replace 'ietf-l3vpn-svc:multipoint' with 'multipoint' for backward compatibility - network_access['site-network-access-type'] = network_access['site-network-access-type'].replace('ietf-l3vpn-svc:', '') - if network_access['site-network-access-type'] != 'multipoint': - MSG = 'Site Network Access Type: {:s}' - raise NotImplementedError(MSG.format(str(network_access['site-network-access-type']))) - device_uuid = network_access['device-reference'] service_uuid = network_access['vpn-attachment']['vpn-id'] - access_role : str = network_access['vpn-attachment']['site-role'] - access_role = access_role.replace('ietf-l3vpn-svc:', '').replace('-role', '') # hub/spoke - if access_role not in {'hub', 'spoke'}: - MSG = 'Site VPN Attackment Role: {:s}' - raise NotImplementedError(MSG.format(str(network_access['site-network-access-type']))) - ipv4_allocation = network_access['ip-connection']['ipv4'] if 'ietf-l3vpn-svc' in ipv4_allocation['address-allocation-type']: # replace 'ietf-l3vpn-svc:static-address' with 'static-address' for backward compatibility @@ -244,10 +230,6 @@ def update_site_network_access( network_access : Dict, errors : List[Dict] ) -> None: - if network_access['site-network-access-type'] != 'ietf-l3vpn-svc:multipoint': - MSG = 'Site Network Access Type: {:s}' - raise NotImplementedError(MSG.format(str(network_access['site-network-access-type']))) - service_uuid = network_access['vpn-attachment']['vpn-id'] service_input_bandwidth = network_access['service']['svc-input-bandwidth'] -- GitLab