1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-22 13:34:04 +03:00

Added merged from v1.9 that did not goes as expected... :)

This commit is contained in:
Adolfo Gómez García 2015-11-05 10:34:16 +01:00
parent 4bc6d88006
commit 1c1003eb41

View File

@ -555,7 +555,16 @@ class UserServiceManager(object):
raise ServiceInMaintenanceMode()
logger.debug('Found service: {0}'.format(userService))
trans = Transport.objects.get(uuid=idTransport)
if idTransport is None: # Find a suitable transport
for v in userService.deployed_service.transports.order_by('priority'):
if v.validForIp(srcIp):
idTransport = v.uuid
break
try:
trans = Transport.objects.get(uuid=idTransport)
except Exception:
raise InvalidServiceException()
# Ensures that the transport is allowed for this service
if trans not in userService.deployed_service.transports.all():