Loading src/service/service/service_handlers/l3nm_ietfslice/L3NM_IETFSlice_ServiceHandler.py +10 −5 Original line number Diff line number Diff line Loading @@ -82,8 +82,12 @@ class L3NM_IETFSlice_ServiceHandler(_ServiceHandler): raise Exception(MSG.format(len(candidate_slice), str(candidate_slice))) candidate_slice = candidate_slice[0] slice_name = candidate_slice['id'] # 4. Extract data from SDP matching src/dst node conn_groups = candidate_slice.get('connection-groups', dict()) # 4. Adapt SDPs candidate_sdps = candidate_slice.get('sdps', dict()).get('sdp', list()) if len(candidate_sdps) != 2: MSG = 'Unsupported number of SDPs[{:d}]({:s})' Loading @@ -104,7 +108,7 @@ class L3NM_IETFSlice_ServiceHandler(_ServiceHandler): dst_mgmt_ip_address = str(ipaddress.ip_address(dst_device_name)) except ValueError: dst_mgmt_ip_address = '0.0.0.0' dst_device_sdp['sdp-ip-address'] = dst_mgmt_ip_address dst_device_sdp['sdp-ip-address'] = [dst_mgmt_ip_address] dst_ac = dst_device_sdp['attachment-circuits']['attachment-circuit'][0] dst_ac['id'] = 'AC {:s}'.format(str(dst_device_name)) Loading @@ -126,7 +130,7 @@ class L3NM_IETFSlice_ServiceHandler(_ServiceHandler): src_mgmt_ip_address = str(ipaddress.ip_address(src_device_name)) except ValueError: src_mgmt_ip_address = '0.0.0.0' src_device_sdp['sdp-ip-address'] = src_mgmt_ip_address src_device_sdp['sdp-ip-address'] = [src_mgmt_ip_address] src_ac = src_device_sdp['attachment-circuits']['attachment-circuit'][0] src_ac['id'] = 'AC {:s}'.format(str(src_device_name)) Loading @@ -138,9 +142,10 @@ class L3NM_IETFSlice_ServiceHandler(_ServiceHandler): MSG = 'Unsupported case: sdp_dict={:s} src_device_name={:s} dst_device_name={:s}' raise Exception(MSG.format(str(sdp_dict), str(src_device_name), str(dst_device_name))) conn_groups = candidate_slice.get('connection-groups', dict()) slice_name = self.__service.name # 5. Compose slice and setup it slice_data_model = {'network-slice-services': {'slice-service': [{ 'id': slice_name, 'description': slice_name, Loading Loading
src/service/service/service_handlers/l3nm_ietfslice/L3NM_IETFSlice_ServiceHandler.py +10 −5 Original line number Diff line number Diff line Loading @@ -82,8 +82,12 @@ class L3NM_IETFSlice_ServiceHandler(_ServiceHandler): raise Exception(MSG.format(len(candidate_slice), str(candidate_slice))) candidate_slice = candidate_slice[0] slice_name = candidate_slice['id'] # 4. Extract data from SDP matching src/dst node conn_groups = candidate_slice.get('connection-groups', dict()) # 4. Adapt SDPs candidate_sdps = candidate_slice.get('sdps', dict()).get('sdp', list()) if len(candidate_sdps) != 2: MSG = 'Unsupported number of SDPs[{:d}]({:s})' Loading @@ -104,7 +108,7 @@ class L3NM_IETFSlice_ServiceHandler(_ServiceHandler): dst_mgmt_ip_address = str(ipaddress.ip_address(dst_device_name)) except ValueError: dst_mgmt_ip_address = '0.0.0.0' dst_device_sdp['sdp-ip-address'] = dst_mgmt_ip_address dst_device_sdp['sdp-ip-address'] = [dst_mgmt_ip_address] dst_ac = dst_device_sdp['attachment-circuits']['attachment-circuit'][0] dst_ac['id'] = 'AC {:s}'.format(str(dst_device_name)) Loading @@ -126,7 +130,7 @@ class L3NM_IETFSlice_ServiceHandler(_ServiceHandler): src_mgmt_ip_address = str(ipaddress.ip_address(src_device_name)) except ValueError: src_mgmt_ip_address = '0.0.0.0' src_device_sdp['sdp-ip-address'] = src_mgmt_ip_address src_device_sdp['sdp-ip-address'] = [src_mgmt_ip_address] src_ac = src_device_sdp['attachment-circuits']['attachment-circuit'][0] src_ac['id'] = 'AC {:s}'.format(str(src_device_name)) Loading @@ -138,9 +142,10 @@ class L3NM_IETFSlice_ServiceHandler(_ServiceHandler): MSG = 'Unsupported case: sdp_dict={:s} src_device_name={:s} dst_device_name={:s}' raise Exception(MSG.format(str(sdp_dict), str(src_device_name), str(dst_device_name))) conn_groups = candidate_slice.get('connection-groups', dict()) slice_name = self.__service.name # 5. Compose slice and setup it slice_data_model = {'network-slice-services': {'slice-service': [{ 'id': slice_name, 'description': slice_name, Loading