forked from shaba/openuds
fixes
This commit is contained in:
parent
eae79364b8
commit
fb818f06a5
@ -138,7 +138,7 @@ class Services(DetailHandler): # pylint: disable=too-many-public-methods
|
||||
def saveItem(self, parent, item):
|
||||
# Extract item db fields
|
||||
# We need this fields for all
|
||||
logger.debug('Saving service {0} / {1}'.format(parent, item))
|
||||
logger.debug('Saving service for {0} / {1}'.format(parent, item))
|
||||
fields = self.readFieldsFromParams(['name', 'comments', 'data_type', 'tags', 'proxy_id'])
|
||||
tags = fields['tags']
|
||||
del fields['tags']
|
||||
|
@ -78,12 +78,19 @@ class IPMachinesService(services.Service):
|
||||
return {'ipList': gui.convertToList(ips)}
|
||||
|
||||
def marshal(self):
|
||||
logger.debug('Marshal: %s', self._ips)
|
||||
self.storage.saveData('ips', pickle.dumps(self._ips))
|
||||
return 'v1'
|
||||
return b'v1'
|
||||
|
||||
def unmarshal(self, vals):
|
||||
if vals == 'v1':
|
||||
self._ips = pickle.loads(str(self.storage.readData('ips')))
|
||||
logger.debug('Vals %s', vals)
|
||||
if vals == b'v1':
|
||||
vals = self.storage.readData('ips')
|
||||
try:
|
||||
self._ips = pickle.loads(vals)
|
||||
except: # Legacy "as string"
|
||||
self._ips = pickle.loads(vals.encode('utf8'))
|
||||
logger.debug('Unmarshal: %s', self._ips)
|
||||
|
||||
def getUnassignedMachine(self):
|
||||
# Search first unassigned machine
|
||||
|
Loading…
Reference in New Issue
Block a user