Loading src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/Handlers.py +3 −14 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ import logging, netaddr from typing import Dict, List, Optional, Tuple from common.Constants import DEFAULT_CONTEXT_NAME from common.proto.context_pb2 import Service, ServiceStatusEnum, ServiceTypeEnum, Empty from common.proto.context_pb2 import Service, ServiceStatusEnum, ServiceTypeEnum from common.tools.context_queries.Service import get_service_by_uuid from common.tools.grpc.ConfigRules import update_config_rule_custom from common.tools.grpc.Constraints import ( Loading Loading @@ -97,11 +97,8 @@ def update_service_endpoint( endpoint_settings_key = ENDPOINT_SETTINGS_KEY.format(device_uuid, endpoint_uuid) field_updates = {} if vlan_tag is not None: field_updates['vlan_tag' ] = (vlan_tag, True) # if ipv4_address is not None: field_updates['ip_address' ] = (ipv4_address, True) # if neighbor_ipv4_address is not None: field_updates['neighbor_address'] = (neighbor_ipv4_address, True) #! neighbor_ipv4_address and ipv4_address' field swapped to manage the PE. Fix it later if ipv4_address is not None: field_updates['ip_address' ] = (neighbor_ipv4_address, True) if neighbor_ipv4_address is not None: field_updates['neighbor_address'] = (ipv4_address, True) if ipv4_address is not None: field_updates['ip_address' ] = (ipv4_address, True) if neighbor_ipv4_address is not None: field_updates['neighbor_address'] = (neighbor_ipv4_address, True) if ipv4_prefix_length is not None: field_updates['prefix_length' ] = (ipv4_prefix_length, True) update_config_rule_custom(config_rules, endpoint_settings_key, field_updates) Loading @@ -116,8 +113,6 @@ def update_service_endpoint( def process_site_network_access( site_id : str, network_access : Dict, site_static_routing : Dict[Tuple[str, str], str], errors : List[Dict] ) -> None: # client = ContextClient() # devices = client.ListDevices(Empty()).devices endpoint_uuid = network_access['site-network-access-id'] if network_access['site-network-access-type'] != 'ietf-l3vpn-svc:multipoint': Loading @@ -125,12 +120,6 @@ def process_site_network_access( raise NotImplementedError(MSG.format(str(network_access['site-network-access-type']))) device_uuid = network_access['device-reference'] # location = network_access['location-reference'] # for device in devices: # for cr in device.device_config.config_rules: # if cr.WhichOneof('config_rule') != 'custom': # continue service_uuid = network_access['vpn-attachment']['vpn-id'] access_role : str = network_access['vpn-attachment']['site-role'] Loading Loading
src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/Handlers.py +3 −14 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ import logging, netaddr from typing import Dict, List, Optional, Tuple from common.Constants import DEFAULT_CONTEXT_NAME from common.proto.context_pb2 import Service, ServiceStatusEnum, ServiceTypeEnum, Empty from common.proto.context_pb2 import Service, ServiceStatusEnum, ServiceTypeEnum from common.tools.context_queries.Service import get_service_by_uuid from common.tools.grpc.ConfigRules import update_config_rule_custom from common.tools.grpc.Constraints import ( Loading Loading @@ -97,11 +97,8 @@ def update_service_endpoint( endpoint_settings_key = ENDPOINT_SETTINGS_KEY.format(device_uuid, endpoint_uuid) field_updates = {} if vlan_tag is not None: field_updates['vlan_tag' ] = (vlan_tag, True) # if ipv4_address is not None: field_updates['ip_address' ] = (ipv4_address, True) # if neighbor_ipv4_address is not None: field_updates['neighbor_address'] = (neighbor_ipv4_address, True) #! neighbor_ipv4_address and ipv4_address' field swapped to manage the PE. Fix it later if ipv4_address is not None: field_updates['ip_address' ] = (neighbor_ipv4_address, True) if neighbor_ipv4_address is not None: field_updates['neighbor_address'] = (ipv4_address, True) if ipv4_address is not None: field_updates['ip_address' ] = (ipv4_address, True) if neighbor_ipv4_address is not None: field_updates['neighbor_address'] = (neighbor_ipv4_address, True) if ipv4_prefix_length is not None: field_updates['prefix_length' ] = (ipv4_prefix_length, True) update_config_rule_custom(config_rules, endpoint_settings_key, field_updates) Loading @@ -116,8 +113,6 @@ def update_service_endpoint( def process_site_network_access( site_id : str, network_access : Dict, site_static_routing : Dict[Tuple[str, str], str], errors : List[Dict] ) -> None: # client = ContextClient() # devices = client.ListDevices(Empty()).devices endpoint_uuid = network_access['site-network-access-id'] if network_access['site-network-access-type'] != 'ietf-l3vpn-svc:multipoint': Loading @@ -125,12 +120,6 @@ def process_site_network_access( raise NotImplementedError(MSG.format(str(network_access['site-network-access-type']))) device_uuid = network_access['device-reference'] # location = network_access['location-reference'] # for device in devices: # for cr in device.device_config.config_rules: # if cr.WhichOneof('config_rule') != 'custom': # continue service_uuid = network_access['vpn-attachment']['vpn-id'] access_role : str = network_access['vpn-attachment']['site-role'] Loading