def cache(self): LOG.debug(_(u'Loading Proxy Cache Driver')) try: mgr = oslo_cache.get_cache(self.conf) return mgr except RuntimeError as exc: LOG.exception(exc) raise exceptions.InvalidDriver(exc)
def storage(self): LOG.debug(_(u'Loading Storage Driver')) try: mgr = driver.DriverManager('marconi.storage', CFG.storage, invoke_on_load=True) return mgr.driver except RuntimeError as exc: LOG.exception(exc) raise exceptions.InvalidDriver(exc)
def transport(self): LOG.debug(_(u'Loading Transport Driver')) try: mgr = driver.DriverManager('marconi.transport', CFG.transport, invoke_on_load=True, invoke_args=[self.storage]) return mgr.driver except RuntimeError as exc: LOG.exception(exc) raise exceptions.InvalidDriver(exc)
def transport(self): LOG.debug(_(u'Loading Proxy Transport Driver')) try: mgr = driver.DriverManager(self._transport_type, CFG['proxy:drivers'].transport, invoke_on_load=True, invoke_args=[self.storage, self.cache]) return mgr.driver except RuntimeError as exc: LOG.exception(exc) raise exceptions.InvalidDriver(exc)
def transport(self): transport_name = self.driver_conf.transport LOG.debug(_(u'Loading transport driver: %s'), transport_name) try: mgr = driver.DriverManager( self._transport_type, transport_name, invoke_on_load=True, invoke_args=[self.conf, self.storage, self.cache]) return mgr.driver except RuntimeError as exc: LOG.exception(exc) raise exceptions.InvalidDriver(exc)
def load_storage_driver(conf): """Loads a storage driver and returns it. The driver's initializer will be passed conf as its only arg. :param conf: Configuration instance to use for loading the driver. Must include a 'queues:drivers' group. """ try: mgr = driver.DriverManager('marconi.queues.data.storage', conf['queues:drivers'].storage, invoke_on_load=True, invoke_args=[conf]) return mgr.driver except RuntimeError as exc: LOG.exception(exc) raise exceptions.InvalidDriver(exc)