Loading src/service/service/ServiceServiceServicerImpl.py +5 −4 Original line number Diff line number Diff line Loading @@ -98,13 +98,14 @@ class ServiceServiceServicerImpl(ServiceServiceServicer): context_client, request.service_id, rw_copy=False, include_config_rules=True, include_constraints=True, include_endpoint_ids=True) location_aware = False gps_location_aware = False for constraint in request.service_constraints: if constraint.WhichOneof('constraint') != 'endpoint_location': continue location_aware = True if constraint.endpoint_location.location.WhichOneof('location') != 'gps_position': continue gps_location_aware = True LOGGER.debug('location_aware={:s}'.format(str(location_aware))) if _service is not None and location_aware: LOGGER.debug('gps_location_aware={:s}'.format(str(gps_location_aware))) if _service is not None and gps_location_aware: LOGGER.debug(' Removing previous service') tasks_scheduler = TasksScheduler(self.service_handler_factory) tasks_scheduler.compose_from_service(_service, is_delete=True) Loading src/tests/ofc22/descriptors_emulated.json +17 −5 Original line number Diff line number Diff line Loading @@ -15,7 +15,9 @@ {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ {"uuid": "13/0/0", "type": "optical", "sample_types": []}, {"uuid": "13/1/2", "type": "copper", "sample_types": [101, 102, 201, 202]} ]}}} ]}}}, {"action": 1, "custom": {"resource_key": "/interface[13/0/0]/settings", "resource_value": {"name": "13/0/0", "enabled": true}}}, {"action": 1, "custom": {"resource_key": "/interface[13/1/2]/settings", "resource_value": {"name": "13/1/2", "enabled": true}}} ]} }, { Loading @@ -27,7 +29,9 @@ {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ {"uuid": "13/0/0", "type": "optical", "sample_types": []}, {"uuid": "13/1/2", "type": "copper", "sample_types": [101, 102, 201, 202]} ]}}} ]}}}, {"action": 1, "custom": {"resource_key": "/interface[13/0/0]/settings", "resource_value": {"name": "13/0/0", "enabled": true}}}, {"action": 1, "custom": {"resource_key": "/interface[13/1/2]/settings", "resource_value": {"name": "13/1/2", "enabled": true}}} ]} }, { Loading @@ -39,7 +43,9 @@ {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ {"uuid": "13/0/0", "type": "optical", "sample_types": []}, {"uuid": "13/1/2", "type": "copper", "sample_types": [101, 102, 201, 202]} ]}}} ]}}}, {"action": 1, "custom": {"resource_key": "/interface[13/0/0]/settings", "resource_value": {"name": "13/0/0", "enabled": true}}}, {"action": 1, "custom": {"resource_key": "/interface[13/1/2]/settings", "resource_value": {"name": "13/1/2", "enabled": true}}} ]} }, { Loading @@ -51,7 +57,9 @@ {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ {"uuid": "13/0/0", "type": "optical", "sample_types": []}, {"uuid": "13/1/2", "type": "copper", "sample_types": [101, 102, 201, 202]} ]}}} ]}}}, {"action": 1, "custom": {"resource_key": "/interface[13/0/0]/settings", "resource_value": {"name": "13/0/0", "enabled": true}}}, {"action": 1, "custom": {"resource_key": "/interface[13/1/2]/settings", "resource_value": {"name": "13/1/2", "enabled": true}}} ]} }, { Loading @@ -65,7 +73,11 @@ {"uuid": "eb287d83-f05e-53ec-ab5a-adf6bd2b5418", "type": "optical", "sample_types": []}, {"uuid": "0ef74f99-1acc-57bd-ab9d-4b958b06c513", "type": "optical", "sample_types": []}, {"uuid": "50296d99-58cc-5ce7-82f5-fc8ee4eec2ec", "type": "optical", "sample_types": []} ]}}} ]}}}, {"action": 1, "custom": {"resource_key": "/interface[aade6001-f00b-5e2f-a357-6a0a9d3de870]/settings", "resource_value": {"name": "aade6001-f00b-5e2f-a357-6a0a9d3de870", "enabled": true}}}, {"action": 1, "custom": {"resource_key": "/interface[eb287d83-f05e-53ec-ab5a-adf6bd2b5418]/settings", "resource_value": {"name": "eb287d83-f05e-53ec-ab5a-adf6bd2b5418", "enabled": true}}}, {"action": 1, "custom": {"resource_key": "/interface[0ef74f99-1acc-57bd-ab9d-4b958b06c513]/settings", "resource_value": {"name": "0ef74f99-1acc-57bd-ab9d-4b958b06c513", "enabled": true}}}, {"action": 1, "custom": {"resource_key": "/interface[50296d99-58cc-5ce7-82f5-fc8ee4eec2ec]/settings", "resource_value": {"name": "50296d99-58cc-5ce7-82f5-fc8ee4eec2ec", "enabled": true}}} ]} } ], Loading Loading
src/service/service/ServiceServiceServicerImpl.py +5 −4 Original line number Diff line number Diff line Loading @@ -98,13 +98,14 @@ class ServiceServiceServicerImpl(ServiceServiceServicer): context_client, request.service_id, rw_copy=False, include_config_rules=True, include_constraints=True, include_endpoint_ids=True) location_aware = False gps_location_aware = False for constraint in request.service_constraints: if constraint.WhichOneof('constraint') != 'endpoint_location': continue location_aware = True if constraint.endpoint_location.location.WhichOneof('location') != 'gps_position': continue gps_location_aware = True LOGGER.debug('location_aware={:s}'.format(str(location_aware))) if _service is not None and location_aware: LOGGER.debug('gps_location_aware={:s}'.format(str(gps_location_aware))) if _service is not None and gps_location_aware: LOGGER.debug(' Removing previous service') tasks_scheduler = TasksScheduler(self.service_handler_factory) tasks_scheduler.compose_from_service(_service, is_delete=True) Loading
src/tests/ofc22/descriptors_emulated.json +17 −5 Original line number Diff line number Diff line Loading @@ -15,7 +15,9 @@ {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ {"uuid": "13/0/0", "type": "optical", "sample_types": []}, {"uuid": "13/1/2", "type": "copper", "sample_types": [101, 102, 201, 202]} ]}}} ]}}}, {"action": 1, "custom": {"resource_key": "/interface[13/0/0]/settings", "resource_value": {"name": "13/0/0", "enabled": true}}}, {"action": 1, "custom": {"resource_key": "/interface[13/1/2]/settings", "resource_value": {"name": "13/1/2", "enabled": true}}} ]} }, { Loading @@ -27,7 +29,9 @@ {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ {"uuid": "13/0/0", "type": "optical", "sample_types": []}, {"uuid": "13/1/2", "type": "copper", "sample_types": [101, 102, 201, 202]} ]}}} ]}}}, {"action": 1, "custom": {"resource_key": "/interface[13/0/0]/settings", "resource_value": {"name": "13/0/0", "enabled": true}}}, {"action": 1, "custom": {"resource_key": "/interface[13/1/2]/settings", "resource_value": {"name": "13/1/2", "enabled": true}}} ]} }, { Loading @@ -39,7 +43,9 @@ {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ {"uuid": "13/0/0", "type": "optical", "sample_types": []}, {"uuid": "13/1/2", "type": "copper", "sample_types": [101, 102, 201, 202]} ]}}} ]}}}, {"action": 1, "custom": {"resource_key": "/interface[13/0/0]/settings", "resource_value": {"name": "13/0/0", "enabled": true}}}, {"action": 1, "custom": {"resource_key": "/interface[13/1/2]/settings", "resource_value": {"name": "13/1/2", "enabled": true}}} ]} }, { Loading @@ -51,7 +57,9 @@ {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ {"uuid": "13/0/0", "type": "optical", "sample_types": []}, {"uuid": "13/1/2", "type": "copper", "sample_types": [101, 102, 201, 202]} ]}}} ]}}}, {"action": 1, "custom": {"resource_key": "/interface[13/0/0]/settings", "resource_value": {"name": "13/0/0", "enabled": true}}}, {"action": 1, "custom": {"resource_key": "/interface[13/1/2]/settings", "resource_value": {"name": "13/1/2", "enabled": true}}} ]} }, { Loading @@ -65,7 +73,11 @@ {"uuid": "eb287d83-f05e-53ec-ab5a-adf6bd2b5418", "type": "optical", "sample_types": []}, {"uuid": "0ef74f99-1acc-57bd-ab9d-4b958b06c513", "type": "optical", "sample_types": []}, {"uuid": "50296d99-58cc-5ce7-82f5-fc8ee4eec2ec", "type": "optical", "sample_types": []} ]}}} ]}}}, {"action": 1, "custom": {"resource_key": "/interface[aade6001-f00b-5e2f-a357-6a0a9d3de870]/settings", "resource_value": {"name": "aade6001-f00b-5e2f-a357-6a0a9d3de870", "enabled": true}}}, {"action": 1, "custom": {"resource_key": "/interface[eb287d83-f05e-53ec-ab5a-adf6bd2b5418]/settings", "resource_value": {"name": "eb287d83-f05e-53ec-ab5a-adf6bd2b5418", "enabled": true}}}, {"action": 1, "custom": {"resource_key": "/interface[0ef74f99-1acc-57bd-ab9d-4b958b06c513]/settings", "resource_value": {"name": "0ef74f99-1acc-57bd-ab9d-4b958b06c513", "enabled": true}}}, {"action": 1, "custom": {"resource_key": "/interface[50296d99-58cc-5ce7-82f5-fc8ee4eec2ec]/settings", "resource_value": {"name": "50296d99-58cc-5ce7-82f5-fc8ee4eec2ec", "enabled": true}}} ]} } ], Loading