From a7116b9e2e1ba854a7090478ec1139199cbc55c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Tue, 23 Apr 2019 13:44:37 +0200 Subject: [PATCH] fixes --- client/full/src/uds/__init__.py | 2 +- server/src/uds/REST/methods/actor.py | 2 +- server/src/uds/REST/methods/services_pools.py | 6 +++++- server/src/uds/core/util/State.py | 7 ++----- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/client/full/src/uds/__init__.py b/client/full/src/uds/__init__.py index e1a4e4eb9..02999d433 100644 --- a/client/full/src/uds/__init__.py +++ b/client/full/src/uds/__init__.py @@ -34,7 +34,7 @@ from __future__ import unicode_literals # On centos, old six release does not includes byte2int, nor six.PY2 import six -VERSION = '2.2.0' +VERSION = '3.0.0' __title__ = 'udclient' __version__ = VERSION diff --git a/server/src/uds/REST/methods/actor.py b/server/src/uds/REST/methods/actor.py index 62f5d1949..9c47a71f5 100644 --- a/server/src/uds/REST/methods/actor.py +++ b/server/src/uds/REST/methods/actor.py @@ -131,7 +131,7 @@ class Actor(Handler): """ logger.debug("Ticket args for GET: {0}".format(self._args)) - secure = self._params.get('secure') in ('1', 'true') + # secure = self._params.get('secure') in ('1', 'true') if len(self._args) != 2: raise RequestError('Invalid request') diff --git a/server/src/uds/REST/methods/services_pools.py b/server/src/uds/REST/methods/services_pools.py index a5da2eb49..4543f4437 100644 --- a/server/src/uds/REST/methods/services_pools.py +++ b/server/src/uds/REST/methods/services_pools.py @@ -414,7 +414,11 @@ class ServicesPools(ModelHandler): pass def deleteItem(self, item): - item.remove() # This will mark it for deletion, but in fact will not delete it directly + try: + logger.debug('Deleting {}'.format(item)) + item.remove() # This will mark it for deletion, but in fact will not delete it directly + except: + logger.exception() # Logs def getLogs(self, item): diff --git a/server/src/uds/core/util/State.py b/server/src/uds/core/util/State.py index a5490ed39..97bda2864 100644 --- a/server/src/uds/core/util/State.py +++ b/server/src/uds/core/util/State.py @@ -30,10 +30,7 @@ """ @author: Adolfo Gómez, dkmaster at dkmon dot com """ -from __future__ import unicode_literals - from django.utils.translation import ugettext_noop as _, ugettext_lazy -import six # States for different objects. Not all objects supports all States @@ -71,7 +68,7 @@ class State(object): LAUNCHING: _('Waiting publication'), PREPARING: _('In preparation'), USABLE: _('Valid'), - REMOVABLE: _('Waiting for removal'), + REMOVABLE: _('Removing'), # Display as it is removing RESTRAINED: _('Restrained'), REMOVING: _('Removing'), REMOVED: _('Removed'), @@ -163,6 +160,6 @@ class State(object): Returns a dictionary with current active locale translation of States to States String """ res = {} - for k, v in six.iteritems(State.string): + for k, v in State.string.items(): res[k] = ugettext_lazy(v) return res