]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Deprecate _ builtin translation function
authorIhar Hrachyshka <ihrachys@redhat.com>
Fri, 27 Nov 2015 20:30:35 +0000 (21:30 +0100)
committerAkihiro Motoki <motoki@da.jp.nec.com>
Sun, 6 Dec 2015 10:39:20 +0000 (19:39 +0900)
This function is discouraged for usage as per oslo.i18n guidelines [1],
so we should deprecate and remove it.

[1] http://docs.openstack.org/developer/oslo.i18n/usage.html

Change-Id: I848ee1dbd16a23c4db42df4690bf139bd769f3e8
Partial-Bug: #1520094

neutron/__init__.py

index fa7a241e59e65ed8293f467d9ca48eebeaaeb1ca..a7964977085e8ce6dd3dc7d0628c785b831b18f3 100644 (file)
@@ -14,6 +14,8 @@
 #    under the License.
 
 import gettext
+
+from debtcollector import removals
 import six
 
 
@@ -21,3 +23,8 @@ if six.PY2:
     gettext.install('neutron', unicode=1)
 else:
     gettext.install('neutron')
+
+
+six.moves.builtins.__dict__['_'] = removals.remove(
+    message='Builtin _ translation function is deprecated in OpenStack; '
+            'use the function from _i18n module for your project.')(_)