A little fix

This commit is contained in:
Adolfo Gómez 2014-05-09 09:56:18 +00:00
parent 195e47f443
commit 2e31d2ec1e
3 changed files with 6 additions and 3 deletions

View File

@ -69,11 +69,13 @@ class CryptoManager(object):
return self._rsa.encrypt(string.encode('utf-8'), '')[0].encode(CryptoManager.CODEC)
def decrypt(self, string):
# import inspect
try:
atfork()
return self._rsa.decrypt(string.decode(CryptoManager.CODEC)).encode('utf-8')
except:
logger.exception('Decripting')
logger.exception('Decripting: {0}'.format(string))
# logger.error(inspect.stack())
return 'decript error'
def xor(self, s1, s2):

View File

@ -86,7 +86,7 @@ class Storage(object):
return self.readData(skey)
def getPickle(self, skey):
return cPickle.loads(self.readData(skey).encode('uft-8'))
return cPickle.loads(self.readData(skey).encode('utf-8'))
def remove(self, skey):
try:

View File

@ -35,7 +35,8 @@ from __future__ import unicode_literals
from django.db import transaction
from uds.core.managers.UserServiceManager import UserServiceManager
from uds.core.util.Config import GlobalConfig
from uds.models import UserService, getSqlDatetime, State
from uds.models import UserService, getSqlDatetime
from uds.core.util.State import State
from uds.core.jobs.Job import Job
from datetime import timedelta
import logging