1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-27 03:21:41 +03:00

Fixed metapool usage && visualization

This commit is contained in:
Adolfo Gómez García 2020-10-05 16:03:49 +02:00
parent e38c05286f
commit cf2c984065
2 changed files with 8 additions and 9 deletions

View File

@ -158,7 +158,11 @@ class MetaAssignedService(DetailHandler):
try: try:
if not item: # All items if not item: # All items
return [MetaAssignedService.itemToDict(parent, k) for k in assignedUserServicesForPools()] result = {}
for k in assignedUserServicesForPools():
result[k.uuid] = MetaAssignedService.itemToDict(parent, k)
return result.values()
return MetaAssignedService.itemToDict(parent, self._getAssignedService(parent, item)) return MetaAssignedService.itemToDict(parent, self._getAssignedService(parent, item))
except Exception: except Exception:
logger.exception('getItems') logger.exception('getItems')

View File

@ -707,15 +707,10 @@ class UserServiceManager:
if usable: if usable:
try: try:
usable[0].validateUser(user) usable[0].validateUser(user)
self.getService(user, os, srcIp, 'F' + usable[0].uuid, usable[1].uuid, doTest=False, clientHostname=clientHostName) return self.getService(user, os, srcIp, 'F' + usable[0].uuid, usable[1].uuid, doTest=False, clientHostname=clientHostName)
except Exception as e: except Exception as e:
logger.info('Meta service %s:%s could not be assigned, trying a new one', usable[0].name, e) logger.info('Meta service %s:%s could not be assigned, trying a new one', usable[0].name, e)
usable = None usable = None
if not usable: log.doLog(meta, log.WARN, "No user service accessible from device (ip {}, os: {})".format(srcIp, os['OS']), log.SERVICE)
log.doLog(meta, log.WARN, "No user service accessible from device (ip {}, os: {})".format(srcIp, os['OS']), log.SERVICE) raise InvalidServiceException(_('The service is not accessible from this device'))
raise InvalidServiceException(_('The service is not accessible from this device'))
logger.debug('Found usable pair: %s', usable)
# We have found an usable deployed already assigned & can be accessed from this, so return it
return None, usable[0], None, usable[1], None