Esempio n. 1
0
 def _update_vms(self, dopoll):
     keymap = dict((o.get_connkey(), o) for o in self.list_vms())
     if not dopoll:
         return [], [], keymap.values()
     return pollhelpers.fetch_vms(
         self._backend, keymap,
         (lambda obj, key: vmmDomain(self, obj, key)))
Esempio n. 2
0
    def _fetch_all_guests_cached(self):
        key = self._FETCH_KEY_GUESTS
        if key in self._fetch_cache:
            return self._fetch_cache[key]

        ignore, ignore, ret = pollhelpers.fetch_vms(self, {},
                                                    lambda obj, ignore: obj)
        ret = [Guest(weakref.ref(self), parsexml=obj.XMLDesc(0))
               for obj in ret.values()]
        if self.cache_object_fetch:
            self._fetch_cache[key] = ret
        return ret
Esempio n. 3
0
    def fetch_all_guests(self):
        # pylint: disable=E1102
        if self.cb_fetch_all_guests:
            return self.cb_fetch_all_guests()
        # pylint: enable=E1102

        key = "vms"
        if key in self._fetch_cache:
            return self._fetch_cache[key]

        ignore, ignore, ret = pollhelpers.fetch_vms(self, {},
                                                    lambda obj, ignore: obj)
        ret = [Guest(weakref.ref(self), parsexml=obj.XMLDesc(0))
               for obj in ret.values()]
        if self.cache_object_fetch:
            self._fetch_cache[key] = ret
        return ret
Esempio n. 4
0
 def _update_vms(self, dopoll):
     keymap = dict((o.get_connkey(), o) for o in self.list_vms())
     if not dopoll:
         return [], [], keymap.values()
     return pollhelpers.fetch_vms(self._backend, keymap,
                 (lambda obj, key: vmmDomain(self, obj, key)))
Esempio n. 5
0
 def _update_vms(self, dopoll):
     if not dopoll:
         return {}, {}, self.vms
     return pollhelpers.fetch_vms(self._backend, self.vms.copy(),
                 (lambda obj, key: vmmDomain(self, obj, key)))
Esempio n. 6
0
 def _update_vms(self, dopoll):
     if not dopoll:
         return {}, {}, self._vms
     return pollhelpers.fetch_vms(self._backend, self._vms.copy(),
                 (lambda obj, key: vmmDomain(self, obj, key)))
Esempio n. 7
0
 def _update_vms(self):
     keymap = dict((o.get_connkey(), o) for o in self.list_vms())
     def cb(obj, key):
         return vmmDomain(self, obj, key)
     return pollhelpers.fetch_vms(self._backend, keymap, cb)