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