Esempio n. 1
0
    def add_extension(self, ext):
        ext = ext.obj
        # Do nothing if the extension doesn't check out
        if not self._check_extension(ext):
            return

        alias = ext.get_alias()
        LOG.debug('Loaded extension: %s', alias)

        if alias in self.extensions:
            raise exception.Error("Found duplicate extension: %s" % alias)
        self.extensions[alias] = ext
Esempio n. 2
0
    def add_driver_extension(self, extension):
        # Add a module driver from the extension.
        # If the stevedore manager is changed to one that doesn't
        # check the extension driver, then it should be done manually here
        # by calling self._check_extension(extension)
        driver = extension.obj
        driver_type = driver.get_type()
        LOG.info('Loaded module driver: %s', driver_type)

        if driver_type in self._drivers:
            raise exception.Error(
                _("Found duplicate driver: %s") % driver_type)
        self._drivers[driver_type] = driver