install neutron_lib international messages

neutron-lib needs to load internationalized file at initialization,
otherwise, international logging message will not work. refer to [1]
zh_CN neutron_lib.po has been completed.

[1] https://review.opendev.org/#/c/536011/

Change-Id: I76ab222da64589528defe434589b92a033ef8cdf
Closes-Bug: #1847586
This commit is contained in:
Frank Wang 2019-10-10 18:53:56 +08:00
parent 710d129ca9
commit 66cbfc813a
1 changed files with 11 additions and 0 deletions

View File

@ -10,10 +10,21 @@
# License for the specific language governing permissions and limitations
# under the License.
import gettext
import pbr.version
import six
from neutron_lib.db import api # noqa
if six.PY2:
# pylint: disable=unexpected-keyword-arg
gettext.install('neutron_lib', unicode=1)
else:
gettext.install('neutron_lib')
# NOTE(boden): neutron_lib.db.api is imported to ensure the ORM event listeners
# are registered upon importing any neutron-lib module. For more details see
# defect https://bugs.launchpad.net/networking-ovn/+bug/1802369