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 errors.InvalidDriver(exc)
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 test_db_instance(self): cache = oslo_cache.get_cache(self.conf) driver = mongodb.DataDriver(self.conf, cache) databases = (driver.message_databases + [driver.queues_database]) for db in databases: self.assertThat(db.name, matchers.StartsWith( driver.mongodb_conf.database))
def setUp(self): super(ShardQueuesTest, self).setUp() conf = self.load_conf('wsgi_mongodb_sharded.conf') conf.register_opts([cfg.StrOpt('storage')], group='drivers') cache = oslo_cache.get_cache(self.conf) control = utils.load_storage_driver(conf, cache, control_mode=True) self.shards_ctrl = control.shards_controller self.driver = sharding.DataDriver(conf, cache, control) self.controller = self.driver.queue_controller # fake two shards for _ in xrange(2): self.shards_ctrl.create(str(uuid.uuid1()), 100, 'sqlite://memory')
def setUp(self): super(ShardCatalogTest, self).setUp() self.conf.register_opts([cfg.StrOpt("storage")], group="drivers") cache = oslo_cache.get_cache(self.conf) control = utils.load_storage_driver(self.conf, cache, control_mode=True) self.catalogue_ctrl = control.catalogue_controller self.shards_ctrl = control.shards_controller # NOTE(cpp-cabrera): populate catalogue self.shard = str(uuid.uuid1()) self.queue = str(uuid.uuid1()) self.project = str(uuid.uuid1()) self.shards_ctrl.create(self.shard, 100, "sqlite://memory") self.catalogue_ctrl.insert(self.project, self.queue, self.shard) self.catalog = sharding.Catalog(self.conf, cache, control)
def setUp(self): super(ControllerBaseTest, self).setUp() if not self.driver_class: self.skipTest("No driver class specified") if not issubclass(self.controller_class, self.controller_base_class): self.skipTest( "{0} is not an instance of {1}. " "Tests not supported".format(self.controller_class, self.controller_base_class) ) cache = oslo_cache.get_cache(self.conf) self.driver = self.driver_class(self.conf, cache) self._prepare_conf() self.addCleanup(self._purge_databases) self.controller = self.controller_class(self.driver)