From 29e062ba5d34c4cefb24c18d0d1992f2678c92d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Wed, 2 Aug 2017 16:08:46 +0200 Subject: [PATCH] Small Fix, so UDS client gets an exception in case of UDS being unable to identify client platform. --- server/src/uds/core/transports/BaseTransport.py | 5 ++--- server/src/uds/transports/RDP/RDPTransport.py | 5 +++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server/src/uds/core/transports/BaseTransport.py b/server/src/uds/core/transports/BaseTransport.py index f1990d53c..b8dd60091 100644 --- a/server/src/uds/core/transports/BaseTransport.py +++ b/server/src/uds/core/transports/BaseTransport.py @@ -40,7 +40,7 @@ from uds.core.transports import protocols import logging -__updated__ = '2016-10-14' +__updated__ = '2017-08-02' logger = logging.getLogger(__name__) @@ -178,8 +178,7 @@ class Transport(Module): ''' return ''' from __future__ import unicode_literals -from PyQt4 import QtCore, QtGui -QtGui.QMessageBox.critical(parent, 'Not supported', 'The transport {transport.name} is not supported on your platform.', QtGui.QMessageBox.Ok) +raise Exception('The transport {transport.name} is not supported on your platform.') '''.format(service=userService, transport=transport) def getLink(self, userService, transport, ip, os, user, password, request): diff --git a/server/src/uds/transports/RDP/RDPTransport.py b/server/src/uds/transports/RDP/RDPTransport.py index e5e3198be..4005a8ad7 100644 --- a/server/src/uds/transports/RDP/RDPTransport.py +++ b/server/src/uds/transports/RDP/RDPTransport.py @@ -44,7 +44,7 @@ logger = logging.getLogger(__name__) READY_CACHE_TIMEOUT = 30 -__updated__ = '2017-06-05' +__updated__ = '2017-08-02' class RDPTransport(BaseRDPTransport): @@ -148,6 +148,7 @@ class RDPTransport(BaseRDPTransport): }.get(m.os) if os is None: - return super(RDPTransport, self).getUDSTransportScript(self, userService, transport, ip, os, user, password, request) + logger.ERROR('Os not detected for RDP Transport: {}'.format(request.META.get('HTTP_USER_AGENT', 'Unknown'))) + return super(RDPTransport, self).getUDSTransportScript(userService, transport, ip, os, user, password, request) return self.getScript('scripts/{}/direct.py'.format(os)).format(m=m)