Example #1
0
    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
Example #2
0
 def manifest_active(self):
     return PickleDict(self.json.get('manifest_active', {}))
Example #3
0
 def manifest(self):
     return PickleDict(self.json.get('manifest', {}))
Example #4
0
 def backup(self):
     return PickleDict(self.json.get('backup', {}))
Example #5
0
 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