From 1c1003eb41717e9c0df0910fc4aa4c8c386f87ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Thu, 5 Nov 2015 10:34:16 +0100 Subject: [PATCH] Added merged from v1.9 that did not goes as expected... :) --- server/src/uds/core/managers/UserServiceManager.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/server/src/uds/core/managers/UserServiceManager.py b/server/src/uds/core/managers/UserServiceManager.py index 512d05abc..8e915daaf 100644 --- a/server/src/uds/core/managers/UserServiceManager.py +++ b/server/src/uds/core/managers/UserServiceManager.py @@ -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():