Loading src/context/service/database/Constraint.py +1 −2 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. import datetime, logging import datetime, logging, json from sqlalchemy import delete #from sqlalchemy.dialects import postgresql from sqlalchemy.dialects.postgresql import insert Loading @@ -24,7 +24,6 @@ from .models.ConstraintModel import ConstraintKindEnum, ServiceConstraintModel, from .models.enums.ConstraintAction import ORM_ConstraintActionEnum, grpc_to_enum__constraint_action from .uuids._Builder import get_uuid_from_string from .uuids.EndPoint import endpoint_get_uuid import json LOGGER = logging.getLogger(__name__) Loading src/service/service/ServiceServiceServicerImpl.py +0 −16 Original line number Diff line number Diff line Loading @@ -135,22 +135,6 @@ class ServiceServiceServicerImpl(ServiceServiceServicer): for config_rule in request.service_config.config_rules: service.service_config.config_rules.add().CopyFrom(config_rule) # pylint: disable=no-member """ for constraint in request.service_constraints: if constraint.WhichOneof('constraint') == 'endpoint_location': device_list = context_client.ListDevices(Empty()) service_location = constraint.endpoint_location.location distances = {} for device in device_list.devices: for endpoint in device.device_endpoints: if not endpoint.endpoint_location.HasField('gps_position'): continue distance = gps_distance(service_location.gps_position, endpoint.endpoint_location.gps_position) distances[distance] = endpoint.endpoint_id closer_endpoint_uuid = distances[min(distances)] service.service_endpoint_ids.append(closer_endpoint_uuid) """ service_id_with_uuids = context_client.SetService(service) # PathComp requires endpoints, constraints and config rules Loading src/service/tests/CommonObjects.py +4 −4 Original line number Diff line number Diff line Loading @@ -19,12 +19,12 @@ from common.tools.object_factory.Topology import json_topology, json_topology_id from context.service.database.uuids._Builder import get_uuid_from_string # ----- Context -------------------------------------------------------------------------------------------------------- CONTEXT_ID = json_context_id(get_uuid_from_string(DEFAULT_CONTEXT_NAME)) CONTEXT = json_context(get_uuid_from_string(DEFAULT_CONTEXT_NAME)) CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_NAME) CONTEXT = json_context(DEFAULT_CONTEXT_NAME) # ----- Topology ------------------------------------------------------------------------------------------------------- TOPOLOGY_ID = json_topology_id(get_uuid_from_string(DEFAULT_TOPOLOGY_NAME), context_id=CONTEXT_ID) TOPOLOGY = json_topology(get_uuid_from_string(DEFAULT_TOPOLOGY_NAME), context_id=CONTEXT_ID) TOPOLOGY_ID = json_topology_id(DEFAULT_TOPOLOGY_NAME, context_id=CONTEXT_ID) TOPOLOGY = json_topology(DEFAULT_TOPOLOGY_NAME, context_id=CONTEXT_ID) # ----- Monitoring Samples --------------------------------------------------------------------------------------------- PACKET_PORT_SAMPLE_TYPES = [ Loading src/service/tests/ServiceHandlersToTest.py +1 −2 Original line number Diff line number Diff line Loading @@ -21,10 +21,9 @@ try: SERVICE_HANDLERS_TO_TEST.append(TEST_SERVICE_HANDLER) except ImportError: pass """ try: from service.tests.ServiceHandler_L3NM_OC import TEST_SERVICE_HANDLER SERVICE_HANDLERS_TO_TEST.append(TEST_SERVICE_HANDLER) except ImportError: pass """ src/service/tests/test_unitary.py +0 −3 Original line number Diff line number Diff line Loading @@ -170,9 +170,6 @@ class TestServiceHandlers: service_with_settings = copy.deepcopy(service_descriptor) service_with_settings['service_config']['config_rules'].extend(service_config_rules) service_with_settings['service_constraints'].extend(service_constraints_location) LOGGER.warning('---------------------------------------------------------') LOGGER.warning(service_with_settings) LOGGER.warning('---------------------------------------------------------') service_client.UpdateService(Service(**service_with_settings)) for endpoint_id in service_endpoint_ids: Loading Loading
src/context/service/database/Constraint.py +1 −2 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. import datetime, logging import datetime, logging, json from sqlalchemy import delete #from sqlalchemy.dialects import postgresql from sqlalchemy.dialects.postgresql import insert Loading @@ -24,7 +24,6 @@ from .models.ConstraintModel import ConstraintKindEnum, ServiceConstraintModel, from .models.enums.ConstraintAction import ORM_ConstraintActionEnum, grpc_to_enum__constraint_action from .uuids._Builder import get_uuid_from_string from .uuids.EndPoint import endpoint_get_uuid import json LOGGER = logging.getLogger(__name__) Loading
src/service/service/ServiceServiceServicerImpl.py +0 −16 Original line number Diff line number Diff line Loading @@ -135,22 +135,6 @@ class ServiceServiceServicerImpl(ServiceServiceServicer): for config_rule in request.service_config.config_rules: service.service_config.config_rules.add().CopyFrom(config_rule) # pylint: disable=no-member """ for constraint in request.service_constraints: if constraint.WhichOneof('constraint') == 'endpoint_location': device_list = context_client.ListDevices(Empty()) service_location = constraint.endpoint_location.location distances = {} for device in device_list.devices: for endpoint in device.device_endpoints: if not endpoint.endpoint_location.HasField('gps_position'): continue distance = gps_distance(service_location.gps_position, endpoint.endpoint_location.gps_position) distances[distance] = endpoint.endpoint_id closer_endpoint_uuid = distances[min(distances)] service.service_endpoint_ids.append(closer_endpoint_uuid) """ service_id_with_uuids = context_client.SetService(service) # PathComp requires endpoints, constraints and config rules Loading
src/service/tests/CommonObjects.py +4 −4 Original line number Diff line number Diff line Loading @@ -19,12 +19,12 @@ from common.tools.object_factory.Topology import json_topology, json_topology_id from context.service.database.uuids._Builder import get_uuid_from_string # ----- Context -------------------------------------------------------------------------------------------------------- CONTEXT_ID = json_context_id(get_uuid_from_string(DEFAULT_CONTEXT_NAME)) CONTEXT = json_context(get_uuid_from_string(DEFAULT_CONTEXT_NAME)) CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_NAME) CONTEXT = json_context(DEFAULT_CONTEXT_NAME) # ----- Topology ------------------------------------------------------------------------------------------------------- TOPOLOGY_ID = json_topology_id(get_uuid_from_string(DEFAULT_TOPOLOGY_NAME), context_id=CONTEXT_ID) TOPOLOGY = json_topology(get_uuid_from_string(DEFAULT_TOPOLOGY_NAME), context_id=CONTEXT_ID) TOPOLOGY_ID = json_topology_id(DEFAULT_TOPOLOGY_NAME, context_id=CONTEXT_ID) TOPOLOGY = json_topology(DEFAULT_TOPOLOGY_NAME, context_id=CONTEXT_ID) # ----- Monitoring Samples --------------------------------------------------------------------------------------------- PACKET_PORT_SAMPLE_TYPES = [ Loading
src/service/tests/ServiceHandlersToTest.py +1 −2 Original line number Diff line number Diff line Loading @@ -21,10 +21,9 @@ try: SERVICE_HANDLERS_TO_TEST.append(TEST_SERVICE_HANDLER) except ImportError: pass """ try: from service.tests.ServiceHandler_L3NM_OC import TEST_SERVICE_HANDLER SERVICE_HANDLERS_TO_TEST.append(TEST_SERVICE_HANDLER) except ImportError: pass """
src/service/tests/test_unitary.py +0 −3 Original line number Diff line number Diff line Loading @@ -170,9 +170,6 @@ class TestServiceHandlers: service_with_settings = copy.deepcopy(service_descriptor) service_with_settings['service_config']['config_rules'].extend(service_config_rules) service_with_settings['service_constraints'].extend(service_constraints_location) LOGGER.warning('---------------------------------------------------------') LOGGER.warning(service_with_settings) LOGGER.warning('---------------------------------------------------------') service_client.UpdateService(Service(**service_with_settings)) for endpoint_id in service_endpoint_ids: Loading