mirror of
https://github.com/dkmstr/openuds.git
synced 2024-12-23 17:34:17 +03:00
py3
This commit is contained in:
parent
fab976fd8f
commit
789084d3ed
@ -958,7 +958,7 @@ class UserInterface(object):
|
||||
self._gui[k].value = val
|
||||
# logger.debug('Value for {0}:{1}'.format(k, val))
|
||||
except Exception:
|
||||
logger.exception('Exception on unserialization')
|
||||
logger.exception('Exception on unserialization on {}'.format(self.__class__))
|
||||
# Values can contain invalid characters, so we log every single char
|
||||
# logger.info('Invalid serialization data on {0} {1}'.format(self, values.encode('hex')))
|
||||
|
||||
|
@ -55,7 +55,7 @@ from uds.models.Util import getSqlDatetime
|
||||
|
||||
import logging
|
||||
|
||||
__updated__ = '2017-11-29'
|
||||
__updated__ = '2018-01-18'
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@ -170,7 +170,8 @@ class UserService(UUIDModel):
|
||||
except Exception as e:
|
||||
# The publication to witch this item points to, does not exists
|
||||
self.publication = None
|
||||
logger.error("Got exception at getInstance of an userService {0} : {1}".format(e.__class__, e))
|
||||
logger.exception("Got exception at getInstance of an userService {}".format(self))
|
||||
logger.error()
|
||||
if serviceInstance.deployedType is None:
|
||||
raise Exception('Class {0} needs deployedType but it is not defined!!!'.format(serviceInstance.__class__.__name__))
|
||||
us = serviceInstance.deployedType(self.getEnvironment(), service=serviceInstance, publication=publicationInstance, osmanager=osmanagerInstance, dbservice=self)
|
||||
@ -386,7 +387,6 @@ class UserService(UUIDModel):
|
||||
|
||||
self.deployed_service.account.stopUsageAccounting(self)
|
||||
|
||||
|
||||
def isUsable(self):
|
||||
'''
|
||||
Returns if this service is usable
|
||||
@ -534,5 +534,6 @@ class UserService(UUIDModel):
|
||||
|
||||
logger.debug('Deleted user service {0}'.format(toDelete))
|
||||
|
||||
|
||||
# Connects a pre deletion signal to Authenticator
|
||||
signals.pre_delete.connect(UserService.beforeDelete, sender=UserService)
|
||||
|
@ -51,7 +51,6 @@ class XenPublication(Publication):
|
||||
_state = ''
|
||||
_task = ''
|
||||
|
||||
|
||||
suggestedTime = 20 # : Suggested recheck time if publication is unfinished in seconds
|
||||
|
||||
def initialize(self):
|
||||
@ -75,14 +74,14 @@ class XenPublication(Publication):
|
||||
"""
|
||||
returns data from an instance of Sample Publication serialized
|
||||
"""
|
||||
return '\t'.join(['v1', self._name, self._reason, self._destroyAfter, self._templateId, self._state, self._task])
|
||||
return '\t'.join(['v1', self._name, self._reason, self._destroyAfter, self._templateId, self._state, self._task]).encode('utf8')
|
||||
|
||||
def unmarshal(self, data):
|
||||
"""
|
||||
deserializes the data and loads it inside instance.
|
||||
"""
|
||||
logger.debug('Data: {0}'.format(data))
|
||||
vals = data.split('\t')
|
||||
vals = data.decode('utf8').split('\t')
|
||||
if vals[0] == 'v1':
|
||||
self._name, self._reason, self._destroyAfter, self._templateId, self._state, self._task = vals[1:]
|
||||
|
||||
@ -130,7 +129,6 @@ class XenPublication(Publication):
|
||||
self._reason = str(e)
|
||||
return State.ERROR
|
||||
|
||||
|
||||
return State.RUNNING
|
||||
|
||||
def finish(self):
|
||||
|
Loading…
Reference in New Issue
Block a user