Skip to content
Snippets Groups Projects
Commit a868d68d authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Pre-release CI/CD pipeline fixes

parent b93dad05
No related branches found
No related tags found
2 merge requests!142Release TeraFlowSDN 2.1,!137Pre-release CI/CD fixes - Service - PathComp
......@@ -20,9 +20,12 @@ def json_endpoint_descriptor(
sample_types : List[int] = [], location : Optional[Dict] = None
) -> Dict:
result = {'uuid': endpoint_uuid, 'type': endpoint_type}
if endpoint_name is not None: result['name'] = endpoint_name
if sample_types is not None and len(sample_types) > 0: result['sample_types'] = sample_types
if location is not None and len(location) > 0: result['location'] = location
if endpoint_name is not None:
result['name'] = endpoint_name
if sample_types is not None and len(sample_types) > 0:
result['sample_types'] = sample_types
if location is not None and len(location) > 0:
result['location'] = location
return result
def json_endpoint_id(device_id : Dict, endpoint_uuid : str, topology_id : Optional[Dict] = None):
......@@ -47,8 +50,10 @@ def json_endpoint(
'endpoint_id': json_endpoint_id(device_id, endpoint_uuid, topology_id=topology_id),
'endpoint_type': endpoint_type,
}
if len(kpi_sample_types) > 0: result['kpi_sample_types'] = copy.deepcopy(kpi_sample_types)
if location: result['endpoint_location'] = copy.deepcopy(location)
if kpi_sample_types is not None and len(kpi_sample_types) > 0:
result['kpi_sample_types'] = copy.deepcopy(kpi_sample_types)
if location is not None:
result['endpoint_location'] = copy.deepcopy(location)
return result
def json_endpoints(
......
......@@ -136,6 +136,7 @@ unit_test service:
# Service preparation
- >
docker run --name $IMAGE_NAME -d -p 3030:3030
--env "LOG_LEVEL=DEBUG"
--env "CONTEXTSERVICE_SERVICE_HOST=${CONTEXTSERVICE_SERVICE_HOST}"
--env "DEVICESERVICE_SERVICE_HOST=${DEVICESERVICE_SERVICE_HOST}"
--env "PATHCOMPSERVICE_SERVICE_HOST=${PATHCOMPSERVICE_SERVICE_HOST}"
......
......@@ -106,6 +106,7 @@ class ServiceServiceServicerImpl(ServiceServiceServicer):
for endpoint_id in request.service_endpoint_ids:
service.service_endpoint_ids.add().CopyFrom(endpoint_id) # pylint: disable=no-member
LOGGER.warning('[before] request={:s}'.format(grpc_message_to_json_string(request)))
for constraint in request.service_constraints:
if constraint.action != ConstraintActionEnum.CONSTRAINTACTION_SET: continue
if constraint.WhichOneof('constraint') != 'endpoint_location': continue
......@@ -130,6 +131,8 @@ class ServiceServiceServicerImpl(ServiceServiceServicer):
]
if closer_endpoint_id not in service_endpoint_ids:
service.service_endpoint_ids.append(closer_endpoint_id)
LOGGER.warning('[after] request={:s}'.format(grpc_message_to_json_string(request)))
LOGGER.warning('[after] service={:s}'.format(grpc_message_to_json_string(service)))
del service.service_constraints[:] # pylint: disable=no-member
for constraint in request.service_constraints:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment