2fe72a0d57
Messages created statically (during import) were not being translated in responses when the Accept-Language header was used to set the expected language in the response. The static messages were being created before the _ built-in had been installed by gettextutils.install(). Change-Id: Ie56b1d3a836bc5f2262d7af68f803a08ebdf016f Resolves-Bug: #1215192
37 lines
1.1 KiB
Python
Executable File
37 lines
1.1 KiB
Python
Executable File
#!/usr/bin/env python
|
|
|
|
import os
|
|
import sys
|
|
|
|
# If ../keystone/__init__.py exists, add ../ to Python search path, so that
|
|
# it will override what happens to be installed in /usr/(local/)lib/python...
|
|
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
|
|
os.pardir,
|
|
os.pardir))
|
|
if os.path.exists(os.path.join(possible_topdir,
|
|
'keystone',
|
|
'__init__.py')):
|
|
sys.path.insert(0, possible_topdir)
|
|
|
|
from keystone.openstack.common import gettextutils
|
|
|
|
# NOTE(blk-u): gettextutils.install() must run to set _ before importing any
|
|
# modules that contain static translated strings.
|
|
gettextutils.install('keystone')
|
|
|
|
from keystone import cli
|
|
from keystone.common import environment
|
|
|
|
|
|
if __name__ == '__main__':
|
|
environment.use_stdlib()
|
|
|
|
dev_conf = os.path.join(possible_topdir,
|
|
'etc',
|
|
'keystone.conf')
|
|
config_files = None
|
|
if os.path.exists(dev_conf):
|
|
config_files = [dev_conf]
|
|
|
|
cli.main(argv=sys.argv, config_files=config_files)
|