Use oslo.i18n lib
Stop using gettextutils from oslo.incubator and replace with the graduated library oslo.i18n Change-Id: I479be348f6e0894ecff5cd93d37ee66648f3ea01
This commit is contained in:
parent
4b062b8005
commit
9991b26db1
@ -14,11 +14,9 @@
|
||||
|
||||
from keystoneclient.v2_0 import client as ksclient
|
||||
|
||||
from ironicclient.common.i18n import _
|
||||
from ironicclient.common import utils
|
||||
from ironicclient import exc
|
||||
from ironicclient.openstack.common import gettextutils
|
||||
|
||||
gettextutils.install('ironicclient')
|
||||
|
||||
|
||||
def _get_ksclient(**kwargs):
|
||||
|
31
ironicclient/common/i18n.py
Normal file
31
ironicclient/common/i18n.py
Normal file
@ -0,0 +1,31 @@
|
||||
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import oslo_i18n
|
||||
|
||||
_translators = oslo_i18n.TranslatorFactory(domain='ironicclient')
|
||||
|
||||
# The primary translation function using the well-known name "_"
|
||||
_ = _translators.primary
|
||||
|
||||
# Translators for log levels.
|
||||
#
|
||||
# The abbreviated names are meant to reflect the usual use of a short
|
||||
# name like '_'. The "L" is for "log" and the other letter comes from
|
||||
# the level.
|
||||
_LI = _translators.log_info
|
||||
_LW = _translators.log_warning
|
||||
_LE = _translators.log_error
|
||||
_LC = _translators.log_critical
|
@ -20,6 +20,7 @@ from __future__ import print_function
|
||||
import argparse
|
||||
import json
|
||||
|
||||
from ironicclient.common.i18n import _
|
||||
from ironicclient import exc
|
||||
from ironicclient.openstack.common import importutils
|
||||
|
||||
|
@ -34,12 +34,10 @@ import six.moves.urllib.parse as urlparse
|
||||
|
||||
import ironicclient
|
||||
from ironicclient import client as iroclient
|
||||
from ironicclient.common.i18n import _
|
||||
from ironicclient.common import utils
|
||||
from ironicclient import exc
|
||||
from ironicclient.openstack.common import cliutils
|
||||
from ironicclient.openstack.common import gettextutils
|
||||
|
||||
gettextutils.install('ironicclient')
|
||||
|
||||
|
||||
LATEST_API_VERSION = ('1', 'latest')
|
||||
|
@ -16,6 +16,7 @@
|
||||
# under the License.
|
||||
|
||||
from ironicclient.common import base
|
||||
from ironicclient.common.i18n import _
|
||||
from ironicclient import exc
|
||||
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
import os
|
||||
|
||||
from ironicclient.common import base
|
||||
from ironicclient.common.i18n import _
|
||||
from ironicclient.common import utils
|
||||
from ironicclient import exc
|
||||
|
||||
|
@ -19,6 +19,7 @@ import argparse
|
||||
|
||||
import six
|
||||
|
||||
from ironicclient.common.i18n import _
|
||||
from ironicclient.common import utils
|
||||
from ironicclient.openstack.common.apiclient import exceptions
|
||||
from ironicclient.openstack.common import cliutils
|
||||
|
@ -1,10 +1,8 @@
|
||||
[DEFAULT]
|
||||
|
||||
# The list of modules to copy from openstack-common
|
||||
module=_i18n
|
||||
module=apiclient
|
||||
module=cliutils
|
||||
module=gettextutils
|
||||
module=importutils
|
||||
module=strutils
|
||||
# The base module to hold the copy of openstack.common
|
||||
|
Loading…
Reference in New Issue
Block a user