def create_app(conf, **kwargs): app = flask.Flask(__name__) app.register_blueprint(rdir_api) app.backend = RdirBackend(conf) app.ns = conf['namespace'] # we want exceptions to be logged if conf.get('log_level') == 'DEBUG': app.config['PROPAGATE_EXCEPTIONS'] = True return app
def create_app(conf, **kwargs): backend = RdirBackend(conf) app = Rdir(conf, backend) # default to sync worker for rdir if not conf.get('worker_class'): conf['worker_class'] = 'sync' # default to 1 worker (concurrency issue with leveldb) if not conf.get('workers'): conf['workers'] = 1 return app
def setUp(self): super(TestRdirBackend, self).setUp() self.db_path = tempfile.mkdtemp() self.conf = {'db_path': self.db_path} self.rdir = RdirBackend(self.conf) self.volume = random_id(32) self.rdir.create(self.volume) self.container_0 = '0' + random_id(63) self.container_1 = '1' + random_id(63) self.container_2 = '2' + random_id(63) self.content_0 = '0' + random_id(31) self.content_1 = '1' + random_id(31) self.chunk_0 = random_id(64)
def create_app(conf, **kwargs): app = flask.Flask(__name__) app.register_blueprint(rdir_api) app.backend = RdirBackend(conf) app.ns = conf['namespace'] # default to sync worker for rdir if not conf.get('worker_class'): conf['worker_class'] = 'sync' # default to 1 worker (concurrency issue with leveldb) if not conf.get('workers'): conf['workers'] = 1 # we want exceptions to be logged if conf.get('log_level') == 'DEBUG': app.config['PROPAGATE_EXCEPTIONS'] = True return app
def setUp(self): super(TestRdirBackend, self).setUp() self.db_path = tempfile.mkdtemp() self.conf = {'db_path': self.db_path} self.rdir = RdirBackend(self.conf)