From 9d1e415c571a02a607a4a873b3b316ca1a91f69c Mon Sep 17 00:00:00 2001 From: gifrerenom <lluis.gifre@cttc.es> Date: Tue, 11 Jul 2023 13:49:44 +0000 Subject: [PATCH] Pre-release CI/CD pipeline fixes --- src/service/service/ServiceServiceServicerImpl.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/service/service/ServiceServiceServicerImpl.py b/src/service/service/ServiceServiceServicerImpl.py index fe66c04e2..cdb4f7660 100644 --- a/src/service/service/ServiceServiceServicerImpl.py +++ b/src/service/service/ServiceServiceServicerImpl.py @@ -18,7 +18,8 @@ from common.method_wrappers.Decorator import MetricsPool, safe_and_metered_rpc_m from common.method_wrappers.ServiceExceptions import ( AlreadyExistsException, InvalidArgumentException, NotFoundException, NotImplementedException, OperationFailedException) -from common.proto.context_pb2 import Connection, Empty, Service, ServiceId, ServiceStatusEnum, ServiceTypeEnum, ConstraintActionEnum +from common.proto.context_pb2 import ( + Connection, Empty, Service, ServiceId, ServiceStatusEnum, ServiceTypeEnum, ConstraintActionEnum) from common.proto.pathcomp_pb2 import PathCompRequest from common.proto.service_pb2_grpc import ServiceServiceServicer from common.tools.context_queries.Service import get_service_by_id @@ -108,6 +109,10 @@ class ServiceServiceServicerImpl(ServiceServiceServicer): LOGGER.warning('[before] request={:s}'.format(grpc_message_to_json_string(request))) for constraint in request.service_constraints: + if constraint.action == ConstraintActionEnum.CONSTRAINTACTION_UNDEFINED: + # Field action is new; assume if not set, it means SET + constraint.action = ConstraintActionEnum.CONSTRAINTACTION_SET + if constraint.action != ConstraintActionEnum.CONSTRAINTACTION_SET: continue if constraint.WhichOneof('constraint') != 'endpoint_location': continue if constraint.endpoint_location.HasField('endpoint_id'): continue -- GitLab