From 2796cbeb070cee05ff3f5432ae0d66a763b7b29d Mon Sep 17 00:00:00 2001
From: gifrerenom <lluis.gifre@cttc.es>
Date: Wed, 12 Jul 2023 13:46:47 +0000
Subject: [PATCH] Fix service teardown durign service update for
 non-gps-location-aware services

---
 src/service/service/ServiceServiceServicerImpl.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/service/service/ServiceServiceServicerImpl.py b/src/service/service/ServiceServiceServicerImpl.py
index 141c6cb3c..f50eee6f6 100644
--- a/src/service/service/ServiceServiceServicerImpl.py
+++ b/src/service/service/ServiceServiceServicerImpl.py
@@ -97,13 +97,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)
-- 
GitLab