Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / brag / server / ceph_brag / app.py
1 from pecan import make_app
2 from ceph_brag import model, json
3 from pecan.hooks import TransactionHook
4
5 def setup_app(config):
6
7     model.init_model()
8     app_conf = dict(config.app)
9
10     return make_app(
11         app_conf.pop('root'),
12         logging=getattr(config, 'logging', {}),
13         hooks=[TransactionHook(model.start,
14                                model.start,
15                                model.commit,
16                                model.rollback,
17                                model.clear)],
18         **app_conf
19     )