From 5d9ee90fbabf7e519b6bbe363c9e39ec34923b65 Mon Sep 17 00:00:00 2001 From: gifrerenom <lluis.gifre@cttc.es> Date: Thu, 20 Apr 2023 08:23:04 +0000 Subject: [PATCH] Compute component: - Updated old get_slice calls to new get_slice_by_uuid --- .../rest_server/nbi_plugins/ietf_l2vpn/L2VPN_Service.py | 6 +++--- .../nbi_plugins/ietf_l2vpn/L2VPN_SiteNetworkAccesses.py | 4 ++-- .../nbi_plugins/ietf_network_slice/NSS_Service.py | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_Service.py b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_Service.py index f12c4526a..9a33cd228 100644 --- a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_Service.py +++ b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_Service.py @@ -17,7 +17,7 @@ from flask import request from flask.json import jsonify from flask_restful import Resource from common.proto.context_pb2 import SliceStatusEnum -from common.tools.context_queries.Slice import get_slice +from common.tools.context_queries.Slice import get_slice_by_uuid from context.client.ContextClient import ContextClient from slice.client.SliceClient import SliceClient from ..tools.Authentication import HTTP_AUTH @@ -34,7 +34,7 @@ class L2VPN_Service(Resource): try: context_client = ContextClient() - target = get_slice(context_client, vpn_id, rw_copy=True) + target = get_slice_by_uuid(context_client, vpn_id, rw_copy=True) if target is None: raise Exception('VPN({:s}) not found in database'.format(str(vpn_id))) @@ -59,7 +59,7 @@ class L2VPN_Service(Resource): try: context_client = ContextClient() - target = get_slice(context_client, vpn_id) + target = get_slice_by_uuid(context_client, vpn_id) if target is None: LOGGER.warning('VPN({:s}) not found in database. Nothing done.'.format(str(vpn_id))) else: diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_SiteNetworkAccesses.py b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_SiteNetworkAccesses.py index ff7ad3c14..7e829479a 100644 --- a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_SiteNetworkAccesses.py +++ b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_SiteNetworkAccesses.py @@ -20,7 +20,7 @@ from flask.wrappers import Response from flask_restful import Resource from werkzeug.exceptions import UnsupportedMediaType from common.proto.context_pb2 import Slice -from common.tools.context_queries.Slice import get_slice +from common.tools.context_queries.Slice import get_slice_by_uuid from common.tools.grpc.ConfigRules import update_config_rule_custom from common.tools.grpc.Constraints import ( update_constraint_custom_dict, update_constraint_endpoint_location, update_constraint_endpoint_priority, @@ -68,7 +68,7 @@ def process_site_network_access(context_client : ContextClient, site_id : str, s address_ip, address_prefix, remote_router, circuit_id ) = mapping - target = get_slice(context_client, vpn_id, rw_copy=True) + target = get_slice_by_uuid(context_client, vpn_id, rw_copy=True) if target is None: raise Exception('VPN({:s}) not found in database'.format(str(vpn_id))) endpoint_ids = target.slice_endpoint_ids # pylint: disable=no-member diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/NSS_Service.py b/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/NSS_Service.py index f9b17c8b1..32ee81e80 100644 --- a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/NSS_Service.py +++ b/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/NSS_Service.py @@ -16,7 +16,7 @@ import logging from flask.json import jsonify from flask_restful import Resource from common.proto.context_pb2 import SliceStatusEnum -from common.tools.context_queries.Slice import get_slice +from common.tools.context_queries.Slice import get_slice_by_uuid from common.tools.grpc.Tools import grpc_message_to_json from context.client.ContextClient import ContextClient from slice.client.SliceClient import SliceClient @@ -32,7 +32,7 @@ class NSS_Service(Resource): try: context_client = ContextClient() - target = get_slice(context_client, slice_id, rw_copy=True) + target = get_slice_by_uuid(context_client, slice_id, rw_copy=True) if target is None: raise Exception('Slice({:s}) not found in database'.format(str(slice_id))) @@ -56,7 +56,7 @@ class NSS_Service(Resource): LOGGER.debug('DELETE Slice ID: {:s}'.format(str(slice_id))) try: context_client = ContextClient() - target = get_slice(context_client, slice_id) + target = get_slice_by_uuid(context_client, slice_id) response = jsonify({}) response.status_code = HTTP_OK -- GitLab