From 7ce56d5f45f7112f0b25061473e64145fc840c98 Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Wed, 8 May 2013 12:07:07 +0100 Subject: Add KEYSTONE_LOCALEDIR env variable Part of fixing bug #995287 Syncs these two commits from oslo-incubator: Support overriding oslo localedir too Add a gettextutils.install() helper function to get a new gettextutils.install() function which allows the default localedir to be overwritten via an environment variable. A few things to note: - the gettext.install() call is moved from common.config to the toplevel scripts to fix cases (e.g. the legacy auth_token middleware) where keystone code might be imported by a program who's default translation domain is not 'keystone'. - we add a gettext.install() call in keystone.test so that tests have the _() builtin installed. Change-Id: I86562b3a65d371673bb21f7179eecc7602bc0775 --- bin/keystone-all | 3 +++ bin/keystone-manage | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/keystone-all b/bin/keystone-all index b38e552b5..7e6711b5d 100755 --- a/bin/keystone-all +++ b/bin/keystone-all @@ -24,6 +24,7 @@ import pbr.version from keystone.common import utils from keystone.common import wsgi_server from keystone import config +from keystone.openstack.common import gettextutils from keystone.openstack.common import importutils @@ -70,6 +71,8 @@ def serve(*servers): if __name__ == '__main__': + gettextutils.install('keystone') + dev_conf = os.path.join(possible_topdir, 'etc', 'keystone.conf') diff --git a/bin/keystone-manage b/bin/keystone-manage index b440ad15a..89ada5bde 100755 --- a/bin/keystone-manage +++ b/bin/keystone-manage @@ -13,11 +13,13 @@ if os.path.exists(os.path.join(possible_topdir, '__init__.py')): sys.path.insert(0, possible_topdir) - from keystone import cli +from keystone.openstack.common import gettextutils if __name__ == '__main__': + gettextutils.install('keystone') + dev_conf = os.path.join(possible_topdir, 'etc', 'keystone.conf') -- cgit v1.2.1