~ubuntu-branches/ubuntu/vivid/ceilometer/vivid

« back to all changes in this revision

Viewing changes to ceilometer/api/app.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2014-03-06 14:44:28 UTC
  • mto: (28.1.1 utopic-proposed) (1.2.1)
  • mto: This revision was merged to the branch mainline in revision 19.
  • Revision ID: package-import@ubuntu.com-20140306144428-rvphsh4igwyulzf0
Tags: upstream-2014.1~b3
ImportĀ upstreamĀ versionĀ 2014.1~b3

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
 
54
54
 
55
55
def setup_app(pecan_config=None, extra_hooks=None):
56
 
    storage_engine = storage.get_engine(cfg.CONF)
57
56
    # FIXME: Replace DBHook with a hooks.TransactionHook
58
57
    app_hooks = [hooks.ConfigHook(),
59
58
                 hooks.DBHook(
60
 
                     storage_engine,
61
 
                     storage_engine.get_connection(cfg.CONF),
 
59
                     storage.get_connection(cfg.CONF),
62
60
                 ),
63
61
                 hooks.PipelineHook(),
64
62
                 hooks.TranslationHook()]
81
79
        guess_content_type_from_ext=False
82
80
    )
83
81
 
84
 
    if pecan_config.app.enable_acl:
 
82
    if getattr(pecan_config.app, 'enable_acl', True):
85
83
        return acl.install(app, cfg.CONF)
86
84
 
87
85
    return app
90
88
class VersionSelectorApplication(object):
91
89
    def __init__(self):
92
90
        pc = get_pecan_config()
 
91
        pc.app.debug = CONF.debug
93
92
        pc.app.enable_acl = (CONF.auth_strategy == 'keystone')
94
93
        if cfg.CONF.enable_v1_api:
95
94
            from ceilometer.api.v1 import app as v1app