From 2520cce4297e44efee70401930a81364c1dd5691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Thu, 8 Jul 2021 17:47:12 +0200 Subject: [PATCH] Fixed error on status check for "respawneable" services --- server/src/uds/web/views/service.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/server/src/uds/web/views/service.py b/server/src/uds/web/views/service.py index 13af5f32..cb6f2f76 100644 --- a/server/src/uds/web/views/service.py +++ b/server/src/uds/web/views/service.py @@ -158,18 +158,13 @@ def userServiceStatus( userService = None status = 'running' # If service exists - if userServiceManager().locateUserService(user=request.user, idService=idService, create=False): + userService = userServiceManager().locateUserService(user=request.user, idService=idService, create=False) + if userService: # Service exists... try: - ( - ip, - userService, - userServiceInstance, - transport, - transportInstance, - ) = userServiceManager().getService( - request.user, request.os, request.ip, idService, idTransport, doTest=True - ) + userServiceInstance = userService.getInstance() + ip = userServiceInstance.getIp() + userService.logIP(ip) # logger.debug('Res: %s %s %s %s %s', ip, userService, userServiceInstance, transport, transportInstance) except ServiceNotReadyError: ip = None @@ -177,7 +172,7 @@ def userServiceStatus( ip = False ready = 'ready' - if userService and userService.getProperty('accessedByClient', '0') != '0': + if userService.getProperty('accessedByClient', '0') != '0': ready = 'accessed' status = 'running' if ip is None else 'error' if ip is False else ready