diff --git a/server/src/uds/core/jobs/Scheduler.py b/server/src/uds/core/jobs/Scheduler.py index 34e94fc3..c968cdab 100644 --- a/server/src/uds/core/jobs/Scheduler.py +++ b/server/src/uds/core/jobs/Scheduler.py @@ -42,7 +42,7 @@ import threading import time import logging -__updated__ = '2014-02-19' +__updated__ = '2014-03-20' logger = logging.getLogger(__name__) @@ -107,7 +107,7 @@ class Scheduler(object): jobInstance = None try: now = getSqlDatetime() # Datetimes are based on database server times - fltr = Q(state=State.FOR_EXECUTE) & (Q(owner_server=self._hostname) | Q(owner_server='')) & (Q(last_execution__gt=now) | Q(next_execution__lt=now)) + fltr = Q(state=State.FOR_EXECUTE) & (Q(last_execution__gt=now) | Q(next_execution__lt=now)) with transaction.atomic(): # If next execution is before now or last execution is in the future (clock changed on this server, we take that task as executable) # This params are all set inside fltr (look at __init__) diff --git a/server/src/uds/core/workers/DeployedServiceCleaner.py b/server/src/uds/core/workers/DeployedServiceCleaner.py index 0260aa27..28b8a3a3 100644 --- a/server/src/uds/core/workers/DeployedServiceCleaner.py +++ b/server/src/uds/core/workers/DeployedServiceCleaner.py @@ -62,7 +62,6 @@ class DeployedServiceRemover(Job): def __init__(self, environment): super(DeployedServiceRemover, self).__init__(environment) - @transaction.atomic def startRemovalOf(self, ds): # Get publications in course...., can be at most 1!!! logger.debug('Removal process of {0}'.format(ds)) @@ -80,7 +79,6 @@ class DeployedServiceRemover(Job): ds.name = ds.name + ' (removed)' ds.save() - @transaction.atomic def continueRemovalOf(self, ds): # First, we remove all publications and user services in "info_state" ds.userServices.select_for_update().filter(state__in=State.INFO_STATES).delete() diff --git a/server/src/uds/osmanagers/WindowsOsManager/WindowsOsManager.py b/server/src/uds/osmanagers/WindowsOsManager/WindowsOsManager.py index 71680b83..52f39945 100644 --- a/server/src/uds/osmanagers/WindowsOsManager/WindowsOsManager.py +++ b/server/src/uds/osmanagers/WindowsOsManager/WindowsOsManager.py @@ -31,7 +31,7 @@ def scrambleMsg(data): for c in data[::-1]: res.append(chr(ord(c) ^ n)) n = (n + ord(c)) & 0xFF - return "".join(res).encode('hex') + return unicode(str.join(str(''), res).encode('hex')) class WindowsOsManager(osmanagers.OSManager): @@ -52,16 +52,15 @@ class WindowsOsManager(osmanagers.OSManager): defvalue='keep' ) - @staticmethod - def validateLen(len): + def validateLen(length): try: - len = int(len) + length = int(length) except Exception: raise osmanagers.OSManager.ValidationException(_('Length must be numeric!!')) - if len > 6 or len < 1: - raise osmanagers.OSManager.ValidationException(_('Length must be betwen 1 and six')) - return len + if length > 6 or length < 1: + raise osmanagers.OSManager.ValidationException(_('Length must be betwen 1 and 6')) + return length def __setProcessUnusedMachines(self): self.processUnusedMachines = self._onLogout == 'remove' diff --git a/server/src/uds/static/adm/js/api.coffee b/server/src/uds/static/adm/js/api.coffee index 93389a01..558855ae 100644 --- a/server/src/uds/static/adm/js/api.coffee +++ b/server/src/uds/static/adm/js/api.coffee @@ -334,7 +334,7 @@ class DetailModelRestApi extends BasicModelRest # Generic "Invoke" method (with no args, if needed, put them on "method" after "?" as normal url would be invoke: (method, success_fnc, fail_fnc) -> - @base.get + @get id: method success: success_fnc fail: fail_fnc diff --git a/server/src/uds/templates/uds/admin/tmpl/configuration.html b/server/src/uds/templates/uds/admin/tmpl/configuration.html index 1ef4fa44..660ef84e 100644 --- a/server/src/uds/templates/uds/admin/tmpl/configuration.html +++ b/server/src/uds/templates/uds/admin/tmpl/configuration.html @@ -18,13 +18,13 @@ {{/ eachKey }}
-
+
{{# eachKey config }}
{{# eachKey value }}
- -
+ +
{{# if value.crypt }}
diff --git a/server/src/uds/xmlrpc/actor/Actor.py b/server/src/uds/xmlrpc/actor/Actor.py index cd3c9b71..6f7638b7 100644 --- a/server/src/uds/xmlrpc/actor/Actor.py +++ b/server/src/uds/xmlrpc/actor/Actor.py @@ -4,27 +4,27 @@ # Copyright (c) 2012 Virtual Cable S.L. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without modification, +# Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # -# * Redistributions of source code must retain the above copyright notice, +# * Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. -# * Neither the name of Virtual Cable S.L. nor the names of its contributors -# may be used to endorse or promote products derived from this software +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software # without specific prior written permission. # -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ''' @@ -39,6 +39,7 @@ import logging logger = logging.getLogger(__name__) + def test(): ''' Simple test function called by actors to test communication. @@ -54,7 +55,7 @@ def message(id_, message, data): @param message: Mesagge received from actor @param data: Extra data ''' - ids = id_.split(",")[:5] # Limit ids received to five... + ids = id_.split(",")[:5] # Limit ids received to five... logger.debug("Called message for id_ {0}, message \"{1}\" and data \"{2}\"".format(ids, message, data)) res = "" try: @@ -65,12 +66,12 @@ def message(id_, message, data): inUse = services[0].in_use res = services[0].getInstance().osmanager().process(services[0], message, data) services = UserService.objects.select_for_update().filter(unique_id__in=ids, state__in=[State.USABLE, State.PREPARING]) - if services.count() > 0 and services[0].in_use != inUse: # If state changed, log it + if services.count() > 0 and services[0].in_use != inUse: # If state changed, log it type_ = inUse and 'login' or 'logout' uniqueId = services[0].unique_id serviceIp = '' username = '' - log.useLog(type_, uniqueId , serviceIp, username) + log.useLog(type_, uniqueId, serviceIp, username) except Exception as e: logger.error("Exception at message (client): {0}".format(e)) res = ""