fixed metapools access

This commit is contained in:
Adolfo Gómez García 2020-05-20 14:04:32 +02:00
parent 158564552e
commit 42b06ff688

View File

@ -689,7 +689,7 @@ class UserServiceManager:
usable = ensureTransport(alreadyAssigned.deployed_service)
# Found already assigned, ensure everythinf is fine
if usable:
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: # No service already assigned, lets find a suitable one
for pool in pools: # Pools are already sorted, and "full" pools are filtered out
@ -699,8 +699,8 @@ class UserServiceManager:
# Stop if a pool-transport is found and can be assigned to user
if usable:
try:
usable[0].validateUser(user)
self.getService(user, os, srcIp, 'F' + usable[0].uuid, usable[1].uuid, doTest=False, clientHostname=clientHostName)
break # If all goes fine, stop here
except Exception as e:
logger.info('Meta service %s:%s could not be assigned, trying a new one', usable[0].name, e)
usable = None
@ -710,6 +710,5 @@ class UserServiceManager:
raise InvalidServiceException(_('The service is not accessible from this device'))
logger.debug('Found usable pair: %s', usable)
usable[0].validateUser(user)
# We have found an usable user service already assigned & can be accessed from this, so return it
# We have found an usable deployed already assigned & can be accessed from this, so return it
return None, usable[0], None, usable[1], None