def __init__(self, libvirt_uri=None, objstore_loc=None): self.objstore = ObjectStore(objstore_loc or config.get_object_store()) self.conn = LibvirtConnection(libvirt_uri) # Register for libvirt events self.events = LibvirtEvents() self.events.handleEnospc(self.conn) self.events.registerPoolEvents(self.conn, self._events_handler, 'storages') self.events.registerNetworkEvents(self.conn, self._events_handler, 'networks') self.events.registerDomainEvents(self.conn, self._events_handler, 'vms') kargs = {'objstore': self.objstore, 'conn': self.conn, 'eventsloop': self.events} models = get_all_model_instances(__name__, __file__, kargs) # Import task model from Wok instances = get_model_instances('wok.model.tasks') for instance in instances: models.append(instance(**kargs)) super(Model, self).__init__(models)
def __init__(self): objstore_loc = wok_config.get_object_store() + '_ginger' self._objstore = ObjectStore(objstore_loc) # Some paths or URI's present in the objectstore have changed after # Wok 2.0.0 release. Check here if a schema upgrade is necessary. upgrade_objectstore_schema(objstore_loc, 'version') kargs = {'objstore': self._objstore} models = get_all_model_instances(__name__, __file__, kargs) # Import task model from Wok instances = get_model_instances('wok.model.tasks') for instance in instances: models.append(instance(**kargs)) super(GingerModel, self).__init__(models)
def __init__(self, libvirt_uri=None, objstore_loc=None): self.objstore = ObjectStore(objstore_loc or config.get_object_store()) self.conn = LibvirtConnection(libvirt_uri) # Register for Libvirt's host ENOSPC event and notify UI if it happens self.events = LibvirtEvents() self.events.handleEnospc(self.conn) kargs = {'objstore': self.objstore, 'conn': self.conn, 'eventsloop': self.events} models = get_all_model_instances(__name__, __file__, kargs) # Import task model from Wok instances = get_model_instances('wok.model.tasks') for instance in instances: models.append(instance(**kargs)) return super(Model, self).__init__(models)
def __init__(self, libvirt_uri=None, objstore_loc=None): self.objstore = ObjectStore(objstore_loc or config.get_object_store()) self.conn = LibvirtConnection(libvirt_uri) # Register for Libvirt's host ENOSPC event and notify UI if it happens self.events = LibvirtEvents() self.events.handleEnospc(self.conn) kargs = { 'objstore': self.objstore, 'conn': self.conn, 'eventsloop': self.events } models = get_all_model_instances(__name__, __file__, kargs) # Import task model from Wok instances = get_model_instances('wok.model.tasks') for instance in instances: models.append(instance(**kargs)) return super(Model, self).__init__(models)
def __init__(self, objstore_loc=None): self.objstore = ObjectStore(objstore_loc) kargs = {'objstore': self.objstore} models = get_all_model_instances(__name__, __file__, kargs) super(Model, self).__init__(models)
def __init__(self, objstore_loc=None): self.objstore = ObjectStore(objstore_loc) kargs = {'objstore': self.objstore} models = get_all_model_instances(__name__, __file__, kargs) return super(Model, self).__init__(models)