forked from shaba/openuds
Fixed error on status check for "respawneable" services
This commit is contained in:
parent
962015c355
commit
2520cce429
@ -158,18 +158,13 @@ def userServiceStatus(
|
|||||||
userService = None
|
userService = None
|
||||||
status = 'running'
|
status = 'running'
|
||||||
# If service exists
|
# 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...
|
# Service exists...
|
||||||
try:
|
try:
|
||||||
(
|
userServiceInstance = userService.getInstance()
|
||||||
ip,
|
ip = userServiceInstance.getIp()
|
||||||
userService,
|
userService.logIP(ip)
|
||||||
userServiceInstance,
|
|
||||||
transport,
|
|
||||||
transportInstance,
|
|
||||||
) = userServiceManager().getService(
|
|
||||||
request.user, request.os, request.ip, idService, idTransport, doTest=True
|
|
||||||
)
|
|
||||||
# logger.debug('Res: %s %s %s %s %s', ip, userService, userServiceInstance, transport, transportInstance)
|
# logger.debug('Res: %s %s %s %s %s', ip, userService, userServiceInstance, transport, transportInstance)
|
||||||
except ServiceNotReadyError:
|
except ServiceNotReadyError:
|
||||||
ip = None
|
ip = None
|
||||||
@ -177,7 +172,7 @@ def userServiceStatus(
|
|||||||
ip = False
|
ip = False
|
||||||
|
|
||||||
ready = 'ready'
|
ready = 'ready'
|
||||||
if userService and userService.getProperty('accessedByClient', '0') != '0':
|
if userService.getProperty('accessedByClient', '0') != '0':
|
||||||
ready = 'accessed'
|
ready = 'accessed'
|
||||||
|
|
||||||
status = 'running' if ip is None else 'error' if ip is False else ready
|
status = 'running' if ip is None else 'error' if ip is False else ready
|
||||||
|
Loading…
x
Reference in New Issue
Block a user