diff --git a/server/src/uds/REST/methods/services.py b/server/src/uds/REST/methods/services.py index 0fa8ac16..e06c7dde 100644 --- a/server/src/uds/REST/methods/services.py +++ b/server/src/uds/REST/methods/services.py @@ -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'] diff --git a/server/src/uds/services/PhysicalMachines/IPMachinesService.py b/server/src/uds/services/PhysicalMachines/IPMachinesService.py index 6b03938f..1913e157 100644 --- a/server/src/uds/services/PhysicalMachines/IPMachinesService.py +++ b/server/src/uds/services/PhysicalMachines/IPMachinesService.py @@ -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