]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/keystone/files/httpd/keystone.py
f5ce498c5152390bd084da88b0962fec2d39ce18
[dsa-puppet.git] / 3rdparty / modules / keystone / files / httpd / keystone.py
1 # Copyright 2013 OpenStack Foundation
2 #
3 #    Licensed under the Apache License, Version 2.0 (the "License"); you may
4 #    not use this file except in compliance with the License. You may obtain
5 #    a copy of the License at
6 #
7 #         http://www.apache.org/licenses/LICENSE-2.0
8 #
9 #    Unless required by applicable law or agreed to in writing, software
10 #    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 #    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 #    License for the specific language governing permissions and limitations
13 #    under the License.
14
15 import logging
16 import os
17
18 from oslo import i18n
19
20
21 # NOTE(dstanek): i18n.enable_lazy() must be called before
22 # keystone.i18n._() is called to ensure it has the desired lazy lookup
23 # behavior. This includes cases, like keystone.exceptions, where
24 # keystone.i18n._() is called at import time.
25 i18n.enable_lazy()
26
27
28 from keystone import backends
29 from keystone.common import dependency
30 from keystone.common import environment
31 from keystone.common import sql
32 from keystone import config
33 from keystone.openstack.common import log
34 from keystone import service
35
36
37 CONF = config.CONF
38
39 config.configure()
40 sql.initialize()
41 config.set_default_for_default_log_levels()
42
43 CONF(project='keystone')
44 config.setup_logging()
45
46 environment.use_stdlib()
47 name = os.path.basename(__file__)
48
49 if CONF.debug:
50     CONF.log_opt_values(log.getLogger(CONF.prog), logging.DEBUG)
51
52
53 drivers = backends.load_backends()
54
55 # NOTE(ldbragst): 'application' is required in this context by WSGI spec.
56 # The following is a reference to Python Paste Deploy documentation
57 # http://pythonpaste.org/deploy/
58 application = service.loadapp('config:%s' % config.find_paste_config(), name)
59
60 dependency.resolve_future_dependencies()