Exemple #1
0
    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)
Exemple #2
0
    def __init__(self):
        self.features = {}

        pckg_namespace = __name__.rsplit('.', 1)[0]

        for mod_name in listPathModules(os.path.dirname(__file__)):
            if mod_name.startswith("_") or mod_name == 'capabilities':
                continue

            instances = get_model_instances(pckg_namespace + '.' + mod_name)
            for instance in instances:
                feat_name = instance.__name__.replace('Model', '')
                try:
                    self.features[feat_name] = instance.is_feature_available
                except AttributeError:
                    self.features[feat_name] = None
Exemple #3
0
    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)
Exemple #4
0
    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)
Exemple #5
0
    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)
Exemple #6
0
    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)