diff --git a/server/src/uds/REST/methods/meta_service_pools.py b/server/src/uds/REST/methods/meta_service_pools.py index e8003b7fa..695449846 100644 --- a/server/src/uds/REST/methods/meta_service_pools.py +++ b/server/src/uds/REST/methods/meta_service_pools.py @@ -158,7 +158,11 @@ class MetaAssignedService(DetailHandler): try: 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)) except Exception: logger.exception('getItems') diff --git a/server/src/uds/core/managers/user_service.py b/server/src/uds/core/managers/user_service.py index 34aadb9da..62a0083b9 100644 --- a/server/src/uds/core/managers/user_service.py +++ b/server/src/uds/core/managers/user_service.py @@ -707,15 +707,10 @@ class UserServiceManager: if usable: try: 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: logger.info('Meta service %s:%s could not be assigned, trying a new one', usable[0].name, e) usable = None - if not usable: - 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')) - - 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 + 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'))