install "_" via gettextutils

avoid using two separate sets of translation messages when
HEAT_LOCALEDIR environment variable presents.

Fixes bug #1196184

Change-Id: Ief773b9f2674909de461e2b07f1b07d3c66521cc
This commit is contained in:
Liang Chen 2013-06-30 14:42:41 +08:00
parent da3b5ecfdd
commit 48b243b35e
11 changed files with 33 additions and 23 deletions

View File

@ -20,7 +20,6 @@ Heat API Server. An OpenStack ReST API to Heat.
import eventlet
eventlet.monkey_patch(os=False)
import gettext
import os
import sys
@ -32,7 +31,9 @@ possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
if os.path.exists(os.path.join(possible_topdir, 'heat', '__init__.py')):
sys.path.insert(0, possible_topdir)
gettext.install('heat', unicode=1)
from heat.openstack.common import gettextutils
gettextutils.install('heat')
from oslo.config import cfg

View File

@ -22,7 +22,6 @@ calls the heat-engine via AMQP RPC to implement them.
import eventlet
eventlet.monkey_patch(os=False)
import gettext
import os
import sys
@ -34,7 +33,9 @@ possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
if os.path.exists(os.path.join(possible_topdir, 'heat', '__init__.py')):
sys.path.insert(0, possible_topdir)
gettext.install('heat', unicode=1)
from heat.openstack.common import gettextutils
gettextutils.install('heat')
from oslo.config import cfg

View File

@ -22,7 +22,6 @@ calls the heat-engine via AMQP RPC to implement them.
import eventlet
eventlet.monkey_patch(os=False)
import gettext
import os
import sys
@ -34,7 +33,9 @@ possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
if os.path.exists(os.path.join(possible_topdir, 'heat', '__init__.py')):
sys.path.insert(0, possible_topdir)
gettext.install('heat', unicode=1)
from heat.openstack.common import gettextutils
gettextutils.install('heat')
from oslo.config import cfg

View File

@ -20,7 +20,6 @@ belonging to a user. It is a convenience application that talks to the heat
API server.
"""
import gettext
import optparse
import os
import os.path
@ -40,7 +39,9 @@ if os.path.exists(os.path.join(possible_topdir, 'heat', '__init__.py')):
scriptname = os.path.basename(sys.argv[0])
gettext.install('heat', unicode=1)
from heat.openstack.common import gettextutils
gettextutils.install('heat')
if scriptname == 'heat-boto':
from heat.cfn_client import boto_client as heat_client

View File

@ -20,7 +20,6 @@ calls made by the user. Normal communications is done via the heat API
which then calls into this engine.
"""
import gettext
import eventlet
eventlet.monkey_patch()
@ -35,7 +34,9 @@ POSSIBLE_TOPDIR = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'heat', '__init__.py')):
sys.path.insert(0, POSSIBLE_TOPDIR)
gettext.install('heat', unicode=1)
from heat.openstack.common import gettextutils
gettextutils.install('heat')
from oslo.config import cfg

View File

@ -20,7 +20,6 @@ information about the cloudwatch alarms and metrics belonging to a user.
It is a convenience application that talks to the heat Cloudwatch API server.
"""
import gettext
import optparse
import os
import os.path
@ -38,7 +37,9 @@ if os.path.exists(os.path.join(possible_topdir, 'heat', '__init__.py')):
scriptname = os.path.basename(sys.argv[0])
gettext.install('heat', unicode=1)
from heat.openstack.common import gettextutils
gettextutils.install('heat')
from heat.cfn_client import boto_client_cloudwatch as heat_client
from heat.version import version_info as version

View File

@ -15,10 +15,11 @@
import urlparse
import httplib
import gettext
import hashlib
gettext.install('heat', unicode=1)
from heat.openstack.common import gettextutils
gettextutils.install('heat')
from heat.common import wsgi
from heat.openstack.common import jsonutils as json

View File

@ -13,9 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
import gettext
from heat.openstack.common import gettextutils
gettextutils.install('heat')
gettext.install('heat', unicode=1)
from heat.api.middleware.version_negotiation import VersionNegotiationFilter
from heat.api.cfn import versions

View File

@ -14,9 +14,10 @@
# under the License.
import routes
import gettext
gettext.install('heat', unicode=1)
from heat.openstack.common import gettextutils
gettextutils.install('heat')
from heat.api.cloudwatch import watch
from heat.common import wsgi

View File

@ -14,9 +14,10 @@
# under the License.
import routes
import gettext
gettext.install('heat', unicode=1)
from heat.openstack.common import gettextutils
gettextutils.install('heat')
from heat.api.openstack.v1 import stacks
from heat.api.openstack.v1 import resources

View File

@ -16,11 +16,11 @@
from __future__ import print_function
import gettext
import sys
gettext.install('heat', unicode=1)
from heat.openstack.common import gettextutils
gettextutils.install('heat')
from oslo.config import cfg
from heat.openstack.common import log as logging