Ejemplo n.º 1
0
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
Ejemplo n.º 2
0
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
Ejemplo n.º 3
0
 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)
Ejemplo n.º 4
0
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
Ejemplo n.º 5
0
 def setUp(self):
     super(TestRdirBackend, self).setUp()
     self.db_path = tempfile.mkdtemp()
     self.conf = {'db_path': self.db_path}
     self.rdir = RdirBackend(self.conf)