diff --git a/VERSION b/VERSION index ccbccc3d..c043eea7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.2.0 +2.2.1 diff --git a/actors/linux/debian/changelog b/actors/linux/debian/changelog index 9ca1f98c..3d58a6c2 100644 --- a/actors/linux/debian/changelog +++ b/actors/linux/debian/changelog @@ -1,3 +1,9 @@ +udsactor (2.2.1) stable; urgency=medium + + * Upgraded to 2.2.1 release + + -- Adolfo Gómez García Thu, 2 Oct 2018 12:44:12 +0200 + udsactor (2.2.0) stable; urgency=medium * Upgraded to 2.2.0 release diff --git a/actors/linux/debian/control b/actors/linux/debian/control index 5ff9465f..3de97ca3 100644 --- a/actors/linux/debian/control +++ b/actors/linux/debian/control @@ -10,22 +10,7 @@ Package: udsactor Section: admin Priority: optional Architecture: all -Depends: policykit-1(>=0.100), python-requests (>=0.8.2), python-qt4 (>=4.9), python-six(>=1.1), python-prctl(>=1.1.1), python (>=2.7), libxss1, xscreensaver, ${misc:Depends} +Depends: policykit-1(>=0.100), python3-requests (>=0.8.2), python3-qt4 (>=4.9), python3-six(>=1.1), python3-prctl(>=1.1.1), python3 (>=3.4), libxss1, xscreensaver, ${misc:Depends} Description: Actor for Universal Desktop Services (UDS) Broker This package provides the required components to allow this machine to work on an environment managed by UDS Broker. - -Package: udsactor-xrdp -Section: x11 -Priority: optional -Architecture: all -Depends: xrdp (>= 0.5.0), udsactor (>= ${binary:Version}), libpam-modules-bin (>=1.0), ${misc:Depends} -Description: UDS Actor component for xrdp - This package provides connection between uds actor and xrdp - -Package: udsactor-nx -Section: x11 -Priority: optional -Architecture: all -Depends: nxnode (>= 3.5.0), udsactor (>= ${binary:Version}), ${misc:Depends} -Description: UDS Actor component for nx - This package provides connection between uds actor and nx + \ No newline at end of file diff --git a/actors/linux/scripts/udsactor b/actors/linux/scripts/udsactor index c04b141a..094dd01e 100755 --- a/actors/linux/scripts/udsactor +++ b/actors/linux/scripts/udsactor @@ -3,4 +3,4 @@ FOLDER=/usr/share/UDSActor cd $FOLDER -python2.7 -m udsactor.linux.UDSActorService $@ +exec python3 -m udsactor.linux.UDSActorService $@ diff --git a/actors/src/UDSActorConfig.py b/actors/src/UDSActorConfig.py index eff9ac0f..67d0f663 100644 --- a/actors/src/UDSActorConfig.py +++ b/actors/src/UDSActorConfig.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2.7 +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (c) 2014 Virtual Cable S.L. @@ -93,6 +93,7 @@ class UDSConfigDialog(QtGui.QDialog): store.writeConfig(cfg) self.close() + if __name__ == "__main__": # If to be run as "sudo" on linux, we will need this to avoid problems diff --git a/actors/src/UDSActorUser.py b/actors/src/UDSActorUser.py index 5c055bf3..312a32ce 100644 --- a/actors/src/UDSActorUser.py +++ b/actors/src/UDSActorUser.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2.7 +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (c) 2014 Virtual Cable S.L. @@ -39,6 +39,7 @@ import pickle import time import datetime import signal +import six from udsactor import ipc from udsactor import utils from udsactor.log import logger @@ -90,8 +91,8 @@ class UDSMessageDialog(QtGui.QDialog): class MessagesProcessor(QtCore.QThread): logoff = QtCore.pyqtSignal(name='logoff') - displayMessage = QtCore.pyqtSignal(QtCore.QString, name='displayMessage') - script = QtCore.pyqtSignal(QtCore.QString, name='script') + displayMessage = QtCore.pyqtSignal(six.text_type, name='displayMessage') + script = QtCore.pyqtSignal(six.text_type, name='script') exit = QtCore.pyqtSignal(name='exit') information = QtCore.pyqtSignal(dict, name='information') @@ -147,11 +148,11 @@ class MessagesProcessor(QtCore.QThread): msgId, data = msg logger.debug('Got Message on User Space: {}:{}'.format(msgId, data)) if msgId == ipc.MSG_MESSAGE: - self.displayMessage.emit(QtCore.QString.fromUtf8(data)) + self.displayMessage.emit(data) elif msgId == ipc.MSG_LOGOFF: self.logoff.emit() elif msgId == ipc.MSG_SCRIPT: - self.script.emit(QtCore.QString.fromUtf8(data)) + self.script.emit(data) elif msgId == ipc.MSG_INFORMATION: self.information.emit(pickle.loads(data)) except Exception as e: diff --git a/actors/src/udsactor/REST.py b/actors/src/udsactor/REST.py index db9dc5d2..5891799a 100644 --- a/actors/src/udsactor/REST.py +++ b/actors/src/udsactor/REST.py @@ -101,6 +101,7 @@ def ensureResultIsOk(result): class Api(object): + def __init__(self, host, masterKey, ssl): self.host = host self.masterKey = masterKey @@ -201,6 +202,8 @@ class Api(object): raise ConnectionError('REST api has not been initialized') if processData: + if not isinstance(data, six.text_type): + data = data.decode('utf8') data = json.dumps({'data': data}) url = self._getUrl('/'.join([self.uuid, msg])) return self._request(url, data)['result'] diff --git a/actors/src/udsactor/__init__.py b/actors/src/udsactor/__init__.py index 50275e8c..69617af9 100644 --- a/actors/src/udsactor/__init__.py +++ b/actors/src/udsactor/__init__.py @@ -34,21 +34,22 @@ from __future__ import unicode_literals # On centos, old six release does not includes byte2int, nor six.PY2 import six -VERSION = '2.2.0' +VERSION = '2.2.1' __title__ = 'udsactor' __version__ = VERSION -__build__ = 0x010755 +__build__ = 0x010756 __author__ = 'Adolfo Gómez ' __license__ = "BSD 3-clause" -__copyright__ = "Copyright 2014-2017 VirtualCable S.L.U." - +__copyright__ = "Copyright 2014-2018 VirtualCable S.L.U." if not hasattr(six, 'byte2int'): if six.PY3: import operator six.byte2int = operator.itemgetter(0) else: + def _byte2int(bs): return ord(bs[0]) + six.byte2int = _byte2int diff --git a/actors/src/udsactor/linux/daemon.py b/actors/src/udsactor/linux/daemon.py index 9b066049..1953b62a 100644 --- a/actors/src/udsactor/linux/daemon.py +++ b/actors/src/udsactor/linux/daemon.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (c) 2014 Virtual Cable S.L. +# Copyright (c) 2014-2018 Virtual Cable S.L. # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, @@ -46,6 +46,7 @@ class Daemon: Usage: subclass the Daemon class and override the run() method """ + def __init__(self, pidfile, stdin='/dev/null', stdout='/dev/null', stderr='/dev/null'): self.stdin = stdin self.stdout = stdout @@ -88,8 +89,8 @@ class Daemon: sys.stdout.flush() sys.stderr.flush() si = open(self.stdin, 'r') - so = open(self.stdout, 'a+') - se = open(self.stderr, 'a+', 0) + so = open(self.stdout, 'ab+') + se = open(self.stderr, 'ab+', 0) os.dup2(si.fileno(), sys.stdin.fileno()) os.dup2(so.fileno(), sys.stdout.fileno()) os.dup2(se.fileno(), sys.stderr.fileno())