def get_imgadm_conf(sources): conf = PickleDict( settings.VMS_IMAGE_IMGADM_CONF ) # PickleDict because it has a dump() method (to json) system_sources = conf.get('sources', []) conf['sources'] = [{ 'type': 'imgapi', 'url': url } for url in sources] + system_sources return conf
def manifest_active(self): return PickleDict(self.json.get('manifest_active', {}))
def manifest(self): return PickleDict(self.json.get('manifest', {}))
def backup(self): return PickleDict(self.json.get('backup', {}))
def _decode(xdata): """Unpickle data from DB and return a PickleDict object""" data = pickle.loads(base64.decodestring(xdata)) if not isinstance(data, PickleDict): data = PickleDict(data) return data