diff --git a/src/service/service/ServiceServiceServicerImpl.py b/src/service/service/ServiceServiceServicerImpl.py index fe66c04e27dfe5023b2eaa5721adf0484c91e70f..cdb4f76604153fdc605b5cf18cbf43d6ba98571e 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