]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
install "_" via gettextutils
authorLiang Chen <cbjchen@cn.ibm.com>
Sun, 30 Jun 2013 06:42:41 +0000 (14:42 +0800)
committerLiang Chen <cbjchen@cn.ibm.com>
Sun, 30 Jun 2013 06:42:41 +0000 (14:42 +0800)
avoid using two separate sets of translation messages when
HEAT_LOCALEDIR environment variable presents.

Fixes bug #1196184

Change-Id: Ief773b9f2674909de461e2b07f1b07d3c66521cc

bin/heat-api
bin/heat-api-cfn
bin/heat-api-cloudwatch
bin/heat-cfn
bin/heat-engine
bin/heat-watch
heat/api/aws/ec2token.py
heat/api/cfn/__init__.py
heat/api/cloudwatch/__init__.py
heat/api/openstack/v1/__init__.py
heat/db/sync.py

index 9dc6943e0469a1877ed5407e7147c69fe15a4c58..4ac438596c3d68fe172e0e110494fefb5d8d125f 100755 (executable)
@@ -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
 
index db414d19b17a4dda7fe55767be662680a53a3d20..8eceb6aef4a662ad515777c4e6a6ab443543bd05 100755 (executable)
@@ -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
 
index acd95bfb4c5720011fb0d8574dd535a4fb11c85a..7453b77447427684a10caa898f29f93f81454a2f 100755 (executable)
@@ -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
 
index b26461aa0876b07dad7cf65d985b3eb2e83756e5..fc31938dfdc0e9fc6b23ab6e425a8ccb9b109f31 100755 (executable)
@@ -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
index ef885b1dfceba4483209957c408971dbfacdaeef..3e0167a4425e1e7055d0ccf79101164d487a2133 100755 (executable)
@@ -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
 
index 12e4264aa597bad750a17617b04b5941c7fc77d3..21b97417ab0845e75dadfd76576786f833d0e552 100755 (executable)
@@ -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
index daaf32b8caa140a0f051cb88b81fe66b65307af0..4ad185076270a2a233493c567725df44ed636b86 100644 (file)
 
 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
index b39691f4a0836d7a57caf765f15f904f85f6f844..b7e12f7439d8848bd6f505afd6674a39be3a8dc2 100644 (file)
 #    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
index f8567bd0856ff141468b256d745975618f9c6107..a49db0df8996e2b9ab2476bd5603ae61ae184353 100644 (file)
 #    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
index 2f65ad8189c7ef514fbabe218249ac6ef75fb466..cb2f17b59b048a3c8be98ba5bb5466e291a69785 100644 (file)
 #    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
index d95d6c556ba53bfab293231a103ea3198da7b1d0..9eac77992aaecc62498fd83ad5bf122dcb3d4d51 100755 (executable)
 
 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