Graduate to oslo.i18n and cleanup incubator usage
Graduate from Oslo Incubator to oslo.i18n library. Cleanup of unused Oslo Incubator utils. Added optional enable_lazy() usage. Change-Id: I5ec02477f3f52f4d7097669120581e82cced3748 Signed-off-by: Chuck Short <chuck.short@canonical.com>
This commit is contained in:
parent
911c61fe45
commit
29d6c613f6
|
@ -0,0 +1,47 @@
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
"""oslo.i18n integration module.
|
||||||
|
|
||||||
|
See http://docs.openstack.org/developer/oslo.i18n/usage.html
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
import oslo_i18n
|
||||||
|
|
||||||
|
# NOTE(dhellmann): This reference to o-s-l-o will be replaced by the
|
||||||
|
# application name when this module is synced into the separate
|
||||||
|
# repository. It is OK to have more than one translation function
|
||||||
|
# using the same domain, since there will still only be one message
|
||||||
|
# catalog.
|
||||||
|
_translators = oslo_i18n.TranslatorFactory(domain='heatclient')
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
|
||||||
|
def get_available_languages():
|
||||||
|
return oslo_i18n.get_available_languages('heatclient')
|
||||||
|
|
||||||
|
|
||||||
|
def enable_lazy():
|
||||||
|
return oslo_i18n.enable_lazy()
|
|
@ -18,8 +18,8 @@ from six.moves.urllib import parse as urlparse
|
||||||
from swiftclient import client as sc
|
from swiftclient import client as sc
|
||||||
from swiftclient import utils as swiftclient_utils
|
from swiftclient import utils as swiftclient_utils
|
||||||
|
|
||||||
|
from heatclient._i18n import _
|
||||||
from heatclient import exc
|
from heatclient import exc
|
||||||
from heatclient.openstack.common._i18n import _
|
|
||||||
from heatclient.v1 import software_configs
|
from heatclient.v1 import software_configs
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
|
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
from heatclient._i18n import _
|
||||||
from heatclient.common import template_format
|
from heatclient.common import template_format
|
||||||
from heatclient.openstack.common._i18n import _
|
|
||||||
|
|
||||||
|
|
||||||
SECTIONS = (
|
SECTIONS = (
|
||||||
|
|
|
@ -15,9 +15,9 @@
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
from heatclient._i18n import _
|
||||||
from heatclient.common import utils
|
from heatclient.common import utils
|
||||||
import heatclient.exc as exc
|
import heatclient.exc as exc
|
||||||
from heatclient.openstack.common._i18n import _
|
|
||||||
|
|
||||||
|
|
||||||
def get_hook_events(hc, stack_id, event_args, nested_depth=0,
|
def get_hook_events(hc, stack_id, event_args, nested_depth=0,
|
||||||
|
|
|
@ -14,9 +14,9 @@ import logging
|
||||||
|
|
||||||
from oslo_utils import fnmatch
|
from oslo_utils import fnmatch
|
||||||
|
|
||||||
import heatclient.exc as exc
|
from heatclient._i18n import _
|
||||||
from heatclient.openstack.common._i18n import _
|
from heatclient._i18n import _LE
|
||||||
from heatclient.openstack.common._i18n import _LE
|
from heatclient import exc
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
|
@ -27,10 +27,10 @@ import requests
|
||||||
import six
|
import six
|
||||||
from six.moves.urllib import parse
|
from six.moves.urllib import parse
|
||||||
|
|
||||||
|
from heatclient._i18n import _
|
||||||
|
from heatclient._i18n import _LW
|
||||||
from heatclient.common import utils
|
from heatclient.common import utils
|
||||||
from heatclient import exc
|
from heatclient import exc
|
||||||
from heatclient.openstack.common._i18n import _
|
|
||||||
from heatclient.openstack.common._i18n import _LW
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
USER_AGENT = 'python-heatclient'
|
USER_AGENT = 'python-heatclient'
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
import json
|
import json
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
from heatclient.openstack.common._i18n import _
|
from heatclient._i18n import _
|
||||||
|
|
||||||
if hasattr(yaml, 'CSafeLoader'):
|
if hasattr(yaml, 'CSafeLoader'):
|
||||||
yaml_loader = yaml.CSafeLoader
|
yaml_loader = yaml.CSafeLoader
|
||||||
|
|
|
@ -20,11 +20,11 @@ from six.moves.urllib import error
|
||||||
from six.moves.urllib import parse
|
from six.moves.urllib import parse
|
||||||
from six.moves.urllib import request
|
from six.moves.urllib import request
|
||||||
|
|
||||||
|
from heatclient._i18n import _
|
||||||
from heatclient.common import environment_format
|
from heatclient.common import environment_format
|
||||||
from heatclient.common import template_format
|
from heatclient.common import template_format
|
||||||
from heatclient.common import utils
|
from heatclient.common import utils
|
||||||
from heatclient import exc
|
from heatclient import exc
|
||||||
from heatclient.openstack.common._i18n import _
|
|
||||||
|
|
||||||
|
|
||||||
def process_template_path(template_path, object_request=None, existing=False):
|
def process_template_path(template_path, object_request=None, existing=False):
|
||||||
|
|
|
@ -29,9 +29,9 @@ from six.moves.urllib import parse
|
||||||
from six.moves.urllib import request
|
from six.moves.urllib import request
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
from heatclient._i18n import _
|
||||||
|
from heatclient._i18n import _LE
|
||||||
from heatclient import exc
|
from heatclient import exc
|
||||||
from heatclient.openstack.common._i18n import _
|
|
||||||
from heatclient.openstack.common._i18n import _LE
|
|
||||||
from heatclient.openstack.common import cliutils
|
from heatclient.openstack.common import cliutils
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
|
@ -15,7 +15,7 @@ import sys
|
||||||
from oslo_serialization import jsonutils
|
from oslo_serialization import jsonutils
|
||||||
from oslo_utils import reflection
|
from oslo_utils import reflection
|
||||||
|
|
||||||
from heatclient.openstack.common._i18n import _
|
from heatclient._i18n import _
|
||||||
|
|
||||||
verbose = 0
|
verbose = 0
|
||||||
|
|
||||||
|
|
|
@ -1,45 +0,0 @@
|
||||||
# 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.
|
|
||||||
|
|
||||||
"""oslo.i18n integration module.
|
|
||||||
|
|
||||||
See http://docs.openstack.org/developer/oslo.i18n/usage.html
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
try:
|
|
||||||
import oslo_i18n
|
|
||||||
|
|
||||||
# NOTE(dhellmann): This reference to o-s-l-o will be replaced by the
|
|
||||||
# application name when this module is synced into the separate
|
|
||||||
# repository. It is OK to have more than one translation function
|
|
||||||
# using the same domain, since there will still only be one message
|
|
||||||
# catalog.
|
|
||||||
_translators = oslo_i18n.TranslatorFactory(domain='heatclient')
|
|
||||||
|
|
||||||
# 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
|
|
||||||
except ImportError:
|
|
||||||
# NOTE(dims): Support for cases where a project wants to use
|
|
||||||
# code from oslo-incubator, but is not ready to be internationalized
|
|
||||||
# (like tempest)
|
|
||||||
_ = _LI = _LW = _LE = _LC = lambda x: x
|
|
|
@ -46,7 +46,7 @@ from oslo_utils import strutils
|
||||||
import six
|
import six
|
||||||
from six.moves.urllib import parse
|
from six.moves.urllib import parse
|
||||||
|
|
||||||
from heatclient.openstack.common._i18n import _, _LW
|
from heatclient._i18n import _, _LW
|
||||||
from heatclient.openstack.common.apiclient import exceptions
|
from heatclient.openstack.common.apiclient import exceptions
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
|
@ -38,7 +38,7 @@ from oslo_utils import encodeutils
|
||||||
from oslo_utils import importutils
|
from oslo_utils import importutils
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from heatclient.openstack.common._i18n import _
|
from heatclient._i18n import _
|
||||||
from heatclient.openstack.common.apiclient import exceptions
|
from heatclient.openstack.common.apiclient import exceptions
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
|
@ -38,7 +38,7 @@ import sys
|
||||||
|
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from heatclient.openstack.common._i18n import _
|
from heatclient._i18n import _
|
||||||
|
|
||||||
|
|
||||||
class ClientException(Exception):
|
class ClientException(Exception):
|
||||||
|
|
|
@ -28,7 +28,7 @@ from oslo_utils import encodeutils
|
||||||
from oslo_utils import uuidutils
|
from oslo_utils import uuidutils
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from heatclient.openstack.common._i18n import _
|
from heatclient._i18n import _
|
||||||
from heatclient.openstack.common.apiclient import exceptions
|
from heatclient.openstack.common.apiclient import exceptions
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ import prettytable
|
||||||
import six
|
import six
|
||||||
from six import moves
|
from six import moves
|
||||||
|
|
||||||
from heatclient.openstack.common._i18n import _
|
from heatclient._i18n import _
|
||||||
|
|
||||||
|
|
||||||
class MissingArgs(Exception):
|
class MissingArgs(Exception):
|
||||||
|
|
|
@ -19,10 +19,10 @@ from cliff.formatters import base
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
|
|
||||||
|
from heatclient._i18n import _
|
||||||
from heatclient.common import event_utils
|
from heatclient.common import event_utils
|
||||||
from heatclient.common import utils as heat_utils
|
from heatclient.common import utils as heat_utils
|
||||||
from heatclient import exc
|
from heatclient import exc
|
||||||
from heatclient.openstack.common._i18n import _
|
|
||||||
|
|
||||||
|
|
||||||
class ShowEvent(command.ShowOne):
|
class ShowEvent(command.ShowOne):
|
||||||
|
|
|
@ -22,11 +22,11 @@ import six
|
||||||
from six.moves.urllib import request
|
from six.moves.urllib import request
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
from heatclient._i18n import _
|
||||||
from heatclient.common import format_utils
|
from heatclient.common import format_utils
|
||||||
from heatclient.common import template_format
|
from heatclient.common import template_format
|
||||||
from heatclient.common import utils as heat_utils
|
from heatclient.common import utils as heat_utils
|
||||||
from heatclient import exc as heat_exc
|
from heatclient import exc as heat_exc
|
||||||
from heatclient.openstack.common._i18n import _
|
|
||||||
|
|
||||||
|
|
||||||
class DeleteConfig(command.Command):
|
class DeleteConfig(command.Command):
|
||||||
|
|
|
@ -20,11 +20,11 @@ from osc_lib import exceptions as exc
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
from oslo_serialization import jsonutils
|
from oslo_serialization import jsonutils
|
||||||
|
|
||||||
|
from heatclient._i18n import _
|
||||||
from heatclient.common import deployment_utils
|
from heatclient.common import deployment_utils
|
||||||
from heatclient.common import format_utils
|
from heatclient.common import format_utils
|
||||||
from heatclient.common import utils as heat_utils
|
from heatclient.common import utils as heat_utils
|
||||||
from heatclient import exc as heat_exc
|
from heatclient import exc as heat_exc
|
||||||
from heatclient.openstack.common._i18n import _
|
|
||||||
|
|
||||||
|
|
||||||
class CreateDeployment(format_utils.YamlFormat):
|
class CreateDeployment(format_utils.YamlFormat):
|
||||||
|
|
|
@ -24,6 +24,8 @@ from oslo_serialization import jsonutils
|
||||||
import six
|
import six
|
||||||
from six.moves.urllib import request
|
from six.moves.urllib import request
|
||||||
|
|
||||||
|
from heatclient._i18n import _
|
||||||
|
from heatclient._i18n import _LI
|
||||||
from heatclient.common import event_utils
|
from heatclient.common import event_utils
|
||||||
from heatclient.common import format_utils
|
from heatclient.common import format_utils
|
||||||
from heatclient.common import hook_utils
|
from heatclient.common import hook_utils
|
||||||
|
@ -31,8 +33,6 @@ from heatclient.common import http
|
||||||
from heatclient.common import template_utils
|
from heatclient.common import template_utils
|
||||||
from heatclient.common import utils as heat_utils
|
from heatclient.common import utils as heat_utils
|
||||||
from heatclient import exc as heat_exc
|
from heatclient import exc as heat_exc
|
||||||
from heatclient.openstack.common._i18n import _
|
|
||||||
from heatclient.openstack.common._i18n import _LI
|
|
||||||
|
|
||||||
|
|
||||||
class CreateStack(command.ShowOne):
|
class CreateStack(command.ShowOne):
|
||||||
|
|
|
@ -16,9 +16,9 @@ import collections
|
||||||
|
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
|
|
||||||
|
from heatclient._i18n import _
|
||||||
from heatclient.common import format_utils
|
from heatclient.common import format_utils
|
||||||
from heatclient import exc
|
from heatclient import exc
|
||||||
from heatclient.openstack.common._i18n import _
|
|
||||||
|
|
||||||
|
|
||||||
class ListStackFailures(command.Command):
|
class ListStackFailures(command.Command):
|
||||||
|
|
|
@ -18,12 +18,12 @@ from osc_lib.command import command
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
import six
|
||||||
|
|
||||||
|
from heatclient._i18n import _
|
||||||
from heatclient.common import format_utils
|
from heatclient.common import format_utils
|
||||||
from heatclient.common import http
|
from heatclient.common import http
|
||||||
from heatclient.common import template_utils
|
from heatclient.common import template_utils
|
||||||
from heatclient.common import utils as heat_utils
|
from heatclient.common import utils as heat_utils
|
||||||
from heatclient import exc
|
from heatclient import exc
|
||||||
from heatclient.openstack.common._i18n import _
|
|
||||||
|
|
||||||
|
|
||||||
class VersionList(command.Lister):
|
class VersionList(command.Lister):
|
||||||
|
|
|
@ -27,10 +27,10 @@ from oslo_utils import importutils
|
||||||
import six
|
import six
|
||||||
|
|
||||||
import heatclient
|
import heatclient
|
||||||
|
from heatclient._i18n import _
|
||||||
from heatclient import client as heat_client
|
from heatclient import client as heat_client
|
||||||
from heatclient.common import utils
|
from heatclient.common import utils
|
||||||
from heatclient import exc
|
from heatclient import exc
|
||||||
from heatclient.openstack.common._i18n import _
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
osprofiler_profiler = importutils.try_import("osprofiler.profiler")
|
osprofiler_profiler = importutils.try_import("osprofiler.profiler")
|
||||||
|
|
|
@ -22,6 +22,9 @@ import six
|
||||||
from six.moves.urllib import request
|
from six.moves.urllib import request
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
from heatclient._i18n import _
|
||||||
|
from heatclient._i18n import _LI
|
||||||
|
from heatclient._i18n import _LW
|
||||||
from heatclient.common import deployment_utils
|
from heatclient.common import deployment_utils
|
||||||
from heatclient.common import event_utils
|
from heatclient.common import event_utils
|
||||||
from heatclient.common import hook_utils
|
from heatclient.common import hook_utils
|
||||||
|
@ -30,9 +33,6 @@ from heatclient.common import template_format
|
||||||
from heatclient.common import template_utils
|
from heatclient.common import template_utils
|
||||||
from heatclient.common import utils
|
from heatclient.common import utils
|
||||||
import heatclient.exc as exc
|
import heatclient.exc as exc
|
||||||
from heatclient.openstack.common._i18n import _
|
|
||||||
from heatclient.openstack.common._i18n import _LI
|
|
||||||
from heatclient.openstack.common._i18n import _LW
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
|
@ -16,9 +16,9 @@
|
||||||
import six
|
import six
|
||||||
from six.moves.urllib import parse
|
from six.moves.urllib import parse
|
||||||
|
|
||||||
|
from heatclient._i18n import _
|
||||||
from heatclient.common import utils
|
from heatclient.common import utils
|
||||||
from heatclient import exc
|
from heatclient import exc
|
||||||
from heatclient.openstack.common._i18n import _
|
|
||||||
from heatclient.openstack.common.apiclient import base
|
from heatclient.openstack.common.apiclient import base
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue