diff --git a/contrib/extraroute/extraroute/resources/extraroute.py b/contrib/extraroute/extraroute/resources/extraroute.py index 72b84b334..b4dafacb7 100644 --- a/contrib/extraroute/extraroute/resources/extraroute.py +++ b/contrib/extraroute/extraroute/resources/extraroute.py @@ -13,6 +13,7 @@ # under the License. from heat.common import exception +from heat.common.i18n import _ from heat.engine import properties from heat.engine.resources.neutron import neutron diff --git a/contrib/heat_barbican/heat_barbican/resources/order.py b/contrib/heat_barbican/heat_barbican/resources/order.py index ffa02c7e7..5032336a3 100644 --- a/contrib/heat_barbican/heat_barbican/resources/order.py +++ b/contrib/heat_barbican/heat_barbican/resources/order.py @@ -14,6 +14,7 @@ import six from heat.common import exception +from heat.common.i18n import _ from heat.engine import attributes from heat.engine import clients from heat.engine import constraints diff --git a/contrib/heat_barbican/heat_barbican/resources/secret.py b/contrib/heat_barbican/heat_barbican/resources/secret.py index 16e068719..7a2286495 100644 --- a/contrib/heat_barbican/heat_barbican/resources/secret.py +++ b/contrib/heat_barbican/heat_barbican/resources/secret.py @@ -14,6 +14,7 @@ import six from heat.common import exception +from heat.common.i18n import _ from heat.engine import attributes from heat.engine import clients from heat.engine import constraints diff --git a/contrib/heat_zaqar/heat_zaqar/client.py b/contrib/heat_zaqar/heat_zaqar/client.py index 94feba3e1..2405eac67 100644 --- a/contrib/heat_zaqar/heat_zaqar/client.py +++ b/contrib/heat_zaqar/heat_zaqar/client.py @@ -11,6 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. +from heat.common.i18n import _ from heat.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/contrib/heat_zaqar/heat_zaqar/resources/queue.py b/contrib/heat_zaqar/heat_zaqar/resources/queue.py index 8a5037411..5b3c7d171 100644 --- a/contrib/heat_zaqar/heat_zaqar/resources/queue.py +++ b/contrib/heat_zaqar/heat_zaqar/resources/queue.py @@ -12,6 +12,7 @@ # under the License. from heat.common import exception +from heat.common.i18n import _ from heat.engine import attributes from heat.engine import clients from heat.engine import properties diff --git a/contrib/rackspace/rackspace/resources/auto_scale.py b/contrib/rackspace/rackspace/resources/auto_scale.py index acbac0120..f9f36938e 100644 --- a/contrib/rackspace/rackspace/resources/auto_scale.py +++ b/contrib/rackspace/rackspace/resources/auto_scale.py @@ -15,6 +15,7 @@ import copy +from heat.common.i18n import _ from heat.engine import attributes from heat.engine import constraints from heat.engine import properties diff --git a/heat/__init__.py b/heat/__init__.py index 6f4f38fc9..6148d2f7a 100644 --- a/heat/__init__.py +++ b/heat/__init__.py @@ -17,6 +17,3 @@ from oslo import i18n i18n.enable_lazy() -# fixme(elynn): Since install() is deprecated, we should remove it in -# the future -i18n.install('heat') diff --git a/heat/api/cloudwatch/__init__.py b/heat/api/cloudwatch/__init__.py index f852d1528..be340e7ce 100644 --- a/heat/api/cloudwatch/__init__.py +++ b/heat/api/cloudwatch/__init__.py @@ -14,17 +14,11 @@ import routes from webob import Request -from oslo import i18n - from heat.api.cloudwatch import versions from heat.api.cloudwatch import watch from heat.api.middleware.version_negotiation import VersionNegotiationFilter from heat.common import wsgi -# FIXME(elynn): Since install() is deprecated, we should remove it in the -# future. -i18n.install('heat') - class API(wsgi.Router): diff --git a/heat/api/openstack/v1/actions.py b/heat/api/openstack/v1/actions.py index 9f4ffd5cb..3dc75127c 100644 --- a/heat/api/openstack/v1/actions.py +++ b/heat/api/openstack/v1/actions.py @@ -14,6 +14,7 @@ from webob import exc from heat.api.openstack.v1 import util +from heat.common.i18n import _ from heat.common import serializers from heat.common import wsgi from heat.rpc import client as rpc_client diff --git a/heat/api/openstack/v1/events.py b/heat/api/openstack/v1/events.py index 7e4882c08..cddfbe947 100644 --- a/heat/api/openstack/v1/events.py +++ b/heat/api/openstack/v1/events.py @@ -16,6 +16,7 @@ import itertools from webob import exc from heat.api.openstack.v1 import util +from heat.common.i18n import _ from heat.common import identifier from heat.common import serializers from heat.common import wsgi diff --git a/heat/api/openstack/v1/stacks.py b/heat/api/openstack/v1/stacks.py index b5fa73127..89cfb4ed8 100644 --- a/heat/api/openstack/v1/stacks.py +++ b/heat/api/openstack/v1/stacks.py @@ -22,6 +22,7 @@ from webob import exc from heat.api.openstack.v1 import util from heat.api.openstack.v1.views import stacks_view from heat.common import environment_format +from heat.common.i18n import _ from heat.common.i18n import _LW from heat.common import identifier from heat.common import param_utils diff --git a/heat/cmd/manage.py b/heat/cmd/manage.py index b9492b7d5..71ca77690 100644 --- a/heat/cmd/manage.py +++ b/heat/cmd/manage.py @@ -21,6 +21,7 @@ import sys from oslo.config import cfg +from heat.common.i18n import _ from heat.db import api from heat.db import utils from heat.openstack.common import log diff --git a/heat/common/auth_url.py b/heat/common/auth_url.py index 24e562280..3916ffe31 100644 --- a/heat/common/auth_url.py +++ b/heat/common/auth_url.py @@ -19,6 +19,7 @@ from oslo.utils import importutils from webob.exc import HTTPBadRequest from webob.exc import HTTPUnauthorized +from heat.common.i18n import _ from heat.common import wsgi diff --git a/heat/common/config.py b/heat/common/config.py index 42e89e462..89e1ed876 100644 --- a/heat/common/config.py +++ b/heat/common/config.py @@ -20,6 +20,7 @@ import os from eventlet.green import socket from oslo.config import cfg +from heat.common.i18n import _ from heat.common import wsgi from heat.openstack.common import log as logging diff --git a/heat/common/custom_backend_auth.py b/heat/common/custom_backend_auth.py index 4a390ab2c..00409eed9 100644 --- a/heat/common/custom_backend_auth.py +++ b/heat/common/custom_backend_auth.py @@ -22,7 +22,7 @@ import logging import webob.exc -from heat.openstack.common.gettextutils import _ +from heat.common.i18n import _ from heat.openstack.common import local from heat.rpc import client as rpc_client diff --git a/heat/common/environment_format.py b/heat/common/environment_format.py index 4c62c01e9..bf6246601 100644 --- a/heat/common/environment_format.py +++ b/heat/common/environment_format.py @@ -11,6 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. +from heat.common.i18n import _ from heat.common.template_format import yaml from heat.common.template_format import yaml_loader diff --git a/heat/common/exception.py b/heat/common/exception.py index 58cfff763..420284ab2 100644 --- a/heat/common/exception.py +++ b/heat/common/exception.py @@ -22,7 +22,7 @@ import sys import six from six.moves.urllib import parse as urlparse -from heat.openstack.common.gettextutils import _ +from heat.common.i18n import _ from heat.openstack.common import log as logging diff --git a/heat/common/i18n.py b/heat/common/i18n.py index 9a49bbeb3..b02198fc8 100644 --- a/heat/common/i18n.py +++ b/heat/common/i18n.py @@ -18,6 +18,8 @@ from oslo import i18n +from heat.openstack.common import gettextutils + _translators = i18n.TranslatorFactory(domain='heat') @@ -33,3 +35,13 @@ _LI = _translators.log_info _LW = _translators.log_warning _LE = _translators.log_error _LC = _translators.log_critical + +# FIXME(elynn): Parts in oslo-incubator are still using gettextutils._(), etc., +# from oslo-incubator. Until these parts are changed to use oslo.i18n, we'll +# monkey-patch gettextutils._(), _LI(), etc., to use our oslo.i18n versions. +gettextutils._ = _ +gettextutils._LI = _LI +gettextutils._LW = _LW +gettextutils._LE = _LE +gettextutils._LC = _LC +gettextutils.install = i18n.install diff --git a/heat/common/identifier.py b/heat/common/identifier.py index f4789d2a0..40a4b2b13 100644 --- a/heat/common/identifier.py +++ b/heat/common/identifier.py @@ -17,6 +17,8 @@ import re from oslo.utils import encodeutils from six.moves.urllib import parse as urlparse +from heat.common.i18n import _ + class HeatIdentifier(collections.Mapping): diff --git a/heat/common/lifecycle_plugin_utils.py b/heat/common/lifecycle_plugin_utils.py index 78f4e47c8..28a4b2325 100755 --- a/heat/common/lifecycle_plugin_utils.py +++ b/heat/common/lifecycle_plugin_utils.py @@ -15,8 +15,9 @@ ''' Utility for fetching and running plug point implementation classes ''' +from heat.common.i18n import _ +from heat.common.i18n import _LE from heat.engine import resources -from heat.openstack.common.gettextutils import _LE from heat.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/heat/common/param_utils.py b/heat/common/param_utils.py index ceacd0953..7c4d9bc66 100644 --- a/heat/common/param_utils.py +++ b/heat/common/param_utils.py @@ -13,7 +13,7 @@ from oslo.utils import strutils -from heat.openstack.common.gettextutils import _ +from heat.common.i18n import _ def extract_bool(subject): diff --git a/heat/common/short_id.py b/heat/common/short_id.py index e45003680..9dc369018 100644 --- a/heat/common/short_id.py +++ b/heat/common/short_id.py @@ -21,6 +21,8 @@ import uuid from six.moves import xrange +from heat.common.i18n import _ + def _to_byte_string(value, num_bits): """Convert an integer to a big-endian string of bytes with padding. diff --git a/heat/common/template_format.py b/heat/common/template_format.py index 7c7b6f2e8..2c0a5dce9 100644 --- a/heat/common/template_format.py +++ b/heat/common/template_format.py @@ -19,7 +19,7 @@ from oslo.config import cfg import yaml from heat.common import exception -from heat.openstack.common.gettextutils import _ +from heat.common.i18n import _ cfg.CONF.import_opt('max_template_size', 'heat.common.config') diff --git a/heat/common/timeutils.py b/heat/common/timeutils.py index 3fc273755..99b2dc3e9 100644 --- a/heat/common/timeutils.py +++ b/heat/common/timeutils.py @@ -18,6 +18,8 @@ Utilities for handling ISO 8601 duration format. import random import re +from heat.common.i18n import _ + iso_duration_re = re.compile('PT(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?$') diff --git a/heat/common/wsgi.py b/heat/common/wsgi.py index b8dc36c01..379c2aca9 100644 --- a/heat/common/wsgi.py +++ b/heat/common/wsgi.py @@ -34,6 +34,7 @@ from eventlet.green import ssl import eventlet.greenio import eventlet.wsgi from oslo.config import cfg +from oslo import i18n from oslo.utils import importutils from paste import deploy import routes @@ -44,8 +45,8 @@ import webob.exc from heat.api.aws import exception as aws_exception from heat.common import exception +from heat.common.i18n import _ from heat.common import serializers -from heat.openstack.common import gettextutils URL_LENGTH_LIMIT = 50000 @@ -521,7 +522,7 @@ class Request(webob.Request): """ if not self.accept_language: return None - all_languages = gettextutils.get_available_languages('heat') + all_languages = i18n.get_available_languages('heat') return self.accept_language.best_match(all_languages) @@ -735,9 +736,9 @@ def log_exception(err, exc_info): def translate_exception(exc, locale): """Translates all translatable elements of the given exception.""" if isinstance(exc, exception.HeatException): - exc.message = gettextutils.translate(exc.message, locale) + exc.message = i18n.translate(exc.message, locale) else: - exc.message = gettextutils.translate(six.text_type(exc), locale) + exc.message = i18n.translate(six.text_type(exc), locale) if isinstance(exc, webob.exc.HTTPError): # If the explanation is not a Message, that means that the @@ -746,13 +747,13 @@ def translate_exception(exc, locale): # exception is converted to a response, let's actually swap it with # message, since message is what gets passed in at construction time # in the API - if not isinstance(exc.explanation, gettextutils.Message): + if not isinstance(exc.explanation, i18n._message.Message): exc.explanation = six.text_type(exc) exc.detail = '' else: exc.explanation = \ - gettextutils.translate(exc.explanation, locale) - exc.detail = gettextutils.translate(exc.detail, locale) + i18n.translate(exc.explanation, locale) + exc.detail = i18n.translate(exc.detail, locale) return exc diff --git a/heat/db/sync.py b/heat/db/sync.py index e72293949..1ff23ecfc 100755 --- a/heat/db/sync.py +++ b/heat/db/sync.py @@ -17,15 +17,10 @@ from __future__ import print_function import sys from oslo.config import cfg -from oslo import i18n from heat.db import migration from heat.openstack.common import log as logging -# fixme(elynn): Since install() is deprecated, we should remove it in -# the future -i18n.install('heat') - LOG = logging.getLogger(__name__) diff --git a/heat/engine/attributes.py b/heat/engine/attributes.py index a6628476a..773383399 100644 --- a/heat/engine/attributes.py +++ b/heat/engine/attributes.py @@ -14,6 +14,7 @@ import collections import warnings +from heat.common.i18n import _ from heat.engine import constraints as constr from heat.engine import support diff --git a/heat/engine/cfn/functions.py b/heat/engine/cfn/functions.py index 1a3753e8e..4e930b9fe 100644 --- a/heat/engine/cfn/functions.py +++ b/heat/engine/cfn/functions.py @@ -19,6 +19,7 @@ import six from heat.api.aws import utils as aws_utils from heat.common import exception +from heat.common.i18n import _ from heat.engine import function from heat.engine import resource diff --git a/heat/engine/cfn/template.py b/heat/engine/cfn/template.py index 7ee4fee42..15b3fd7e1 100644 --- a/heat/engine/cfn/template.py +++ b/heat/engine/cfn/template.py @@ -15,6 +15,7 @@ import collections import six +from heat.common.i18n import _ from heat.engine.cfn import functions as cfn_funcs from heat.engine import function from heat.engine import parameters diff --git a/heat/engine/clients/os/nova.py b/heat/engine/clients/os/nova.py index c851ea486..454e2d255 100644 --- a/heat/engine/clients/os/nova.py +++ b/heat/engine/clients/os/nova.py @@ -28,6 +28,7 @@ import six from six.moves.urllib import parse as urlparse from heat.common import exception +from heat.common.i18n import _ from heat.engine.clients import client_plugin from heat.engine import scheduler diff --git a/heat/engine/constraints.py b/heat/engine/constraints.py index bf9c2e107..2273eab1e 100644 --- a/heat/engine/constraints.py +++ b/heat/engine/constraints.py @@ -19,6 +19,7 @@ from oslo.utils import strutils import six from heat.common import exception +from heat.common.i18n import _ from heat.engine import resources diff --git a/heat/engine/hot/functions.py b/heat/engine/hot/functions.py index 599f7b3d2..5115370fb 100644 --- a/heat/engine/hot/functions.py +++ b/heat/engine/hot/functions.py @@ -14,6 +14,7 @@ import collections from heat.common import exception +from heat.common.i18n import _ from heat.engine import attributes from heat.engine.cfn import functions as cfn_funcs from heat.engine import function diff --git a/heat/engine/hot/parameters.py b/heat/engine/hot/parameters.py index dd552a00f..d83ef655a 100644 --- a/heat/engine/hot/parameters.py +++ b/heat/engine/hot/parameters.py @@ -13,6 +13,7 @@ # under the License. from heat.common import exception +from heat.common.i18n import _ from heat.engine import constraints as constr from heat.engine import parameters diff --git a/heat/engine/parameters.py b/heat/engine/parameters.py index 18bdfb30a..30cd6b639 100644 --- a/heat/engine/parameters.py +++ b/heat/engine/parameters.py @@ -20,6 +20,7 @@ from oslo.utils import strutils import six from heat.common import exception +from heat.common.i18n import _ from heat.engine import constraints as constr diff --git a/heat/engine/plugin_manager.py b/heat/engine/plugin_manager.py index 50c57a9b9..6a3bd425f 100644 --- a/heat/engine/plugin_manager.py +++ b/heat/engine/plugin_manager.py @@ -19,6 +19,7 @@ import sys from oslo.config import cfg import six +from heat.common.i18n import _ from heat.common import plugin_loader from heat.openstack.common import log diff --git a/heat/engine/properties.py b/heat/engine/properties.py index bca7d552b..672b38bd5 100644 --- a/heat/engine/properties.py +++ b/heat/engine/properties.py @@ -16,6 +16,7 @@ import collections import six from heat.common import exception +from heat.common.i18n import _ from heat.engine import constraints as constr from heat.engine import function from heat.engine import parameters diff --git a/heat/engine/resources/autoscaling.py b/heat/engine/resources/autoscaling.py index d627c9a7b..a1cc61f86 100644 --- a/heat/engine/resources/autoscaling.py +++ b/heat/engine/resources/autoscaling.py @@ -19,6 +19,7 @@ import six from heat.common import environment_format from heat.common import exception +from heat.common.i18n import _ from heat.common import timeutils as iso8601utils from heat.engine import attributes from heat.engine import constraints diff --git a/heat/engine/resources/aws/launch_config.py b/heat/engine/resources/aws/launch_config.py index 4b3dad170..10e078195 100644 --- a/heat/engine/resources/aws/launch_config.py +++ b/heat/engine/resources/aws/launch_config.py @@ -13,6 +13,7 @@ from heat.common import exception +from heat.common.i18n import _ from heat.engine import constraints from heat.engine import properties from heat.engine import resource diff --git a/heat/engine/resources/aws/scaling_policy.py b/heat/engine/resources/aws/scaling_policy.py index 40986bb89..e13a09d4b 100644 --- a/heat/engine/resources/aws/scaling_policy.py +++ b/heat/engine/resources/aws/scaling_policy.py @@ -12,6 +12,7 @@ # under the License. from heat.common import exception +from heat.common.i18n import _ from heat.engine import attributes from heat.engine import constraints diff --git a/heat/engine/resources/ceilometer/alarm.py b/heat/engine/resources/ceilometer/alarm.py index 50fe4d598..e69642d9f 100644 --- a/heat/engine/resources/ceilometer/alarm.py +++ b/heat/engine/resources/ceilometer/alarm.py @@ -14,6 +14,7 @@ import six from heat.common import exception +from heat.common.i18n import _ from heat.engine import constraints from heat.engine import properties from heat.engine import resource diff --git a/heat/engine/resources/cloud_watch.py b/heat/engine/resources/cloud_watch.py index ce7a95072..f14fa567d 100644 --- a/heat/engine/resources/cloud_watch.py +++ b/heat/engine/resources/cloud_watch.py @@ -14,6 +14,7 @@ from oslo.config import cfg from heat.common import exception +from heat.common.i18n import _ from heat.engine import constraints from heat.engine import properties from heat.engine import resource diff --git a/heat/engine/resources/network_interface.py b/heat/engine/resources/network_interface.py index 8e934ec7e..cbb756755 100644 --- a/heat/engine/resources/network_interface.py +++ b/heat/engine/resources/network_interface.py @@ -11,6 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. +from heat.common.i18n import _ from heat.engine import attributes from heat.engine import properties from heat.engine import resource diff --git a/heat/engine/resources/neutron/firewall.py b/heat/engine/resources/neutron/firewall.py index 927d7b39c..042b2eb15 100644 --- a/heat/engine/resources/neutron/firewall.py +++ b/heat/engine/resources/neutron/firewall.py @@ -11,6 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. +from heat.common.i18n import _ from heat.engine import attributes from heat.engine import constraints from heat.engine import properties diff --git a/heat/engine/resources/neutron/floatingip.py b/heat/engine/resources/neutron/floatingip.py index 57e816110..f1212d6a7 100644 --- a/heat/engine/resources/neutron/floatingip.py +++ b/heat/engine/resources/neutron/floatingip.py @@ -11,6 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. +from heat.common.i18n import _ from heat.engine import attributes from heat.engine import properties from heat.engine.resources.neutron import neutron diff --git a/heat/engine/resources/neutron/loadbalancer.py b/heat/engine/resources/neutron/loadbalancer.py index 3cb913f47..b3253ef78 100644 --- a/heat/engine/resources/neutron/loadbalancer.py +++ b/heat/engine/resources/neutron/loadbalancer.py @@ -12,6 +12,7 @@ # under the License. from heat.common import exception +from heat.common.i18n import _ from heat.engine import attributes from heat.engine import constraints from heat.engine import properties diff --git a/heat/engine/resources/neutron/metering.py b/heat/engine/resources/neutron/metering.py index e895a5081..956284ba4 100644 --- a/heat/engine/resources/neutron/metering.py +++ b/heat/engine/resources/neutron/metering.py @@ -11,6 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. +from heat.common.i18n import _ from heat.engine import attributes from heat.engine import constraints from heat.engine import properties diff --git a/heat/engine/resources/neutron/net.py b/heat/engine/resources/neutron/net.py index 0e7748991..873257ff8 100644 --- a/heat/engine/resources/neutron/net.py +++ b/heat/engine/resources/neutron/net.py @@ -11,6 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. +from heat.common.i18n import _ from heat.engine import attributes from heat.engine import properties from heat.engine.resources.neutron import neutron diff --git a/heat/engine/resources/neutron/network_gateway.py b/heat/engine/resources/neutron/network_gateway.py index 958fb0be7..c9a662947 100644 --- a/heat/engine/resources/neutron/network_gateway.py +++ b/heat/engine/resources/neutron/network_gateway.py @@ -15,6 +15,7 @@ # limitations under the License. from heat.common import exception +from heat.common.i18n import _ from heat.engine import attributes from heat.engine import constraints from heat.engine import properties diff --git a/heat/engine/resources/neutron/neutron.py b/heat/engine/resources/neutron/neutron.py index e46e2ff73..3571d4de4 100644 --- a/heat/engine/resources/neutron/neutron.py +++ b/heat/engine/resources/neutron/neutron.py @@ -14,6 +14,7 @@ import warnings from heat.common import exception +from heat.common.i18n import _ from heat.engine import resource from heat.engine import scheduler from heat.openstack.common import log as logging diff --git a/heat/engine/resources/neutron/port.py b/heat/engine/resources/neutron/port.py index eb383dbbd..eb7301d03 100644 --- a/heat/engine/resources/neutron/port.py +++ b/heat/engine/resources/neutron/port.py @@ -11,6 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. +from heat.common.i18n import _ from heat.engine import attributes from heat.engine import constraints from heat.engine import properties diff --git a/heat/engine/resources/neutron/provider_net.py b/heat/engine/resources/neutron/provider_net.py index 179677001..2823d20d2 100644 --- a/heat/engine/resources/neutron/provider_net.py +++ b/heat/engine/resources/neutron/provider_net.py @@ -12,6 +12,7 @@ # under the License. from heat.common import exception +from heat.common.i18n import _ from heat.engine import attributes from heat.engine import constraints from heat.engine import properties diff --git a/heat/engine/resources/neutron/router.py b/heat/engine/resources/neutron/router.py index e222ab6f1..843bf5d8d 100644 --- a/heat/engine/resources/neutron/router.py +++ b/heat/engine/resources/neutron/router.py @@ -12,6 +12,7 @@ # under the License. from heat.common import exception +from heat.common.i18n import _ from heat.engine import attributes from heat.engine import properties from heat.engine.resources.neutron import neutron diff --git a/heat/engine/resources/neutron/security_group.py b/heat/engine/resources/neutron/security_group.py index 74db12b57..019e4d95f 100644 --- a/heat/engine/resources/neutron/security_group.py +++ b/heat/engine/resources/neutron/security_group.py @@ -12,6 +12,7 @@ # under the License. from heat.common import exception +from heat.common.i18n import _ from heat.engine import constraints from heat.engine import properties from heat.engine.resources.neutron import neutron diff --git a/heat/engine/resources/neutron/subnet.py b/heat/engine/resources/neutron/subnet.py index f93a6bc5d..4910554bd 100644 --- a/heat/engine/resources/neutron/subnet.py +++ b/heat/engine/resources/neutron/subnet.py @@ -11,6 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. +from heat.common.i18n import _ from heat.engine import attributes from heat.engine import constraints from heat.engine import properties diff --git a/heat/engine/resources/neutron/vpnservice.py b/heat/engine/resources/neutron/vpnservice.py index 22d43b891..071f0ee5b 100644 --- a/heat/engine/resources/neutron/vpnservice.py +++ b/heat/engine/resources/neutron/vpnservice.py @@ -11,6 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. +from heat.common.i18n import _ from heat.engine import attributes from heat.engine import constraints from heat.engine import properties diff --git a/heat/engine/resources/openstack/scaling_policy.py b/heat/engine/resources/openstack/scaling_policy.py index 0d1fed325..67af32dbe 100644 --- a/heat/engine/resources/openstack/scaling_policy.py +++ b/heat/engine/resources/openstack/scaling_policy.py @@ -12,6 +12,7 @@ # under the License. from heat.common import exception +from heat.common.i18n import _ from heat.engine import attributes from heat.engine import constraints from heat.engine import properties diff --git a/heat/engine/resources/route_table.py b/heat/engine/resources/route_table.py index cefa86d71..835bf5f21 100644 --- a/heat/engine/resources/route_table.py +++ b/heat/engine/resources/route_table.py @@ -11,6 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. +from heat.common.i18n import _ from heat.engine import properties from heat.engine import resource from heat.engine.resources.neutron import neutron diff --git a/heat/engine/resources/s3.py b/heat/engine/resources/s3.py index ae2ff90e9..860e10ed6 100644 --- a/heat/engine/resources/s3.py +++ b/heat/engine/resources/s3.py @@ -13,6 +13,7 @@ from six.moves.urllib import parse as urlparse +from heat.common.i18n import _ from heat.engine import attributes from heat.engine import constraints from heat.engine import properties diff --git a/heat/engine/resources/security_group.py b/heat/engine/resources/security_group.py index ba4576b5e..a685eb017 100644 --- a/heat/engine/resources/security_group.py +++ b/heat/engine/resources/security_group.py @@ -14,6 +14,7 @@ import six from heat.common import exception +from heat.common.i18n import _ from heat.engine import properties from heat.engine import resource diff --git a/heat/engine/resources/software_config/cloud_config.py b/heat/engine/resources/software_config/cloud_config.py index c0f3adc57..c2dfac474 100644 --- a/heat/engine/resources/software_config/cloud_config.py +++ b/heat/engine/resources/software_config/cloud_config.py @@ -11,6 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. +from heat.common.i18n import _ from heat.common.template_format import yaml from heat.common.template_format import yaml_dumper from heat.engine import properties diff --git a/heat/engine/resources/software_config/software_component.py b/heat/engine/resources/software_config/software_component.py index 952c3e8c1..bd3a0b18e 100644 --- a/heat/engine/resources/software_config/software_component.py +++ b/heat/engine/resources/software_config/software_component.py @@ -14,6 +14,7 @@ # under the License. from heat.common import exception +from heat.common.i18n import _ from heat.engine import constraints as constr from heat.engine import properties from heat.engine import resource diff --git a/heat/engine/resources/software_config/software_deployment.py b/heat/engine/resources/software_config/software_deployment.py index baba67a6a..7ff4a1b16 100644 --- a/heat/engine/resources/software_config/software_deployment.py +++ b/heat/engine/resources/software_config/software_deployment.py @@ -18,6 +18,7 @@ import six import uuid from heat.common import exception +from heat.common.i18n import _ from heat.engine import attributes from heat.engine import constraints from heat.engine import properties diff --git a/heat/engine/resources/software_config/structured_config.py b/heat/engine/resources/software_config/structured_config.py index 00f735800..3497c0de7 100644 --- a/heat/engine/resources/software_config/structured_config.py +++ b/heat/engine/resources/software_config/structured_config.py @@ -17,6 +17,7 @@ import collections import functools import six +from heat.common.i18n import _ from heat.engine import properties from heat.engine.resources.software_config import software_config as sc from heat.engine.resources.software_config import software_deployment as sd diff --git a/heat/engine/resources/stack.py b/heat/engine/resources/stack.py index 5308f5f74..94b03d48f 100644 --- a/heat/engine/resources/stack.py +++ b/heat/engine/resources/stack.py @@ -14,6 +14,7 @@ from requests import exceptions from heat.common import exception +from heat.common.i18n import _ from heat.common import template_format from heat.common import urlfetch from heat.engine import attributes diff --git a/heat/engine/resources/subnet.py b/heat/engine/resources/subnet.py index d36f14d2d..245738294 100644 --- a/heat/engine/resources/subnet.py +++ b/heat/engine/resources/subnet.py @@ -11,6 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. +from heat.common.i18n import _ from heat.engine import attributes from heat.engine import properties from heat.engine import resource diff --git a/heat/engine/resources/swift.py b/heat/engine/resources/swift.py index f4d194521..3d97b0d99 100644 --- a/heat/engine/resources/swift.py +++ b/heat/engine/resources/swift.py @@ -13,6 +13,7 @@ from six.moves.urllib import parse as urlparse +from heat.common.i18n import _ from heat.engine import attributes from heat.engine import properties from heat.engine import resource diff --git a/heat/engine/resources/template_resource.py b/heat/engine/resources/template_resource.py index e91a76974..d959a69fa 100644 --- a/heat/engine/resources/template_resource.py +++ b/heat/engine/resources/template_resource.py @@ -18,6 +18,7 @@ from requests import exceptions import six from heat.common import exception +from heat.common.i18n import _ from heat.common import template_format from heat.common import urlfetch from heat.engine import attributes diff --git a/heat/engine/resources/user.py b/heat/engine/resources/user.py index a25c5cf4f..9f3c4d9bc 100644 --- a/heat/engine/resources/user.py +++ b/heat/engine/resources/user.py @@ -12,6 +12,7 @@ # under the License. from heat.common import exception +from heat.common.i18n import _ from heat.engine import attributes from heat.engine import constraints from heat.engine import properties diff --git a/heat/engine/resources/volume.py b/heat/engine/resources/volume.py index 49f66a885..f9aa6b69d 100644 --- a/heat/engine/resources/volume.py +++ b/heat/engine/resources/volume.py @@ -14,6 +14,7 @@ import json from heat.common import exception +from heat.common.i18n import _ from heat.engine import attributes from heat.engine import constraints from heat.engine import properties diff --git a/heat/engine/resources/vpc.py b/heat/engine/resources/vpc.py index 8a08ee8a7..3a16e7469 100644 --- a/heat/engine/resources/vpc.py +++ b/heat/engine/resources/vpc.py @@ -12,6 +12,7 @@ # under the License. from heat.common import exception +from heat.common.i18n import _ from heat.engine import constraints from heat.engine import properties from heat.engine import resource diff --git a/heat/engine/resources/wait_condition.py b/heat/engine/resources/wait_condition.py index 838726319..ffacd4303 100644 --- a/heat/engine/resources/wait_condition.py +++ b/heat/engine/resources/wait_condition.py @@ -15,6 +15,7 @@ import json import uuid from heat.common import exception +from heat.common.i18n import _ from heat.common import identifier from heat.engine import attributes from heat.engine import constraints diff --git a/heat/engine/support.py b/heat/engine/support.py index 10d3001d1..aef73ca3d 100644 --- a/heat/engine/support.py +++ b/heat/engine/support.py @@ -11,6 +11,8 @@ # License for the specific language governing permissions and limitations # under the License. +from heat.common.i18n import _ + SUPPORT_STATUSES = (UNKNOWN, SUPPORTED, PROTOTYPE, DEPRECATED, UNSUPPORTED) = ('UNKNOWN', 'SUPPORTED', 'PROTOTYPE', 'DEPRECATED', 'UNSUPPORTED') diff --git a/heat/engine/template.py b/heat/engine/template.py index 34b05fb9f..6cc0b0466 100644 --- a/heat/engine/template.py +++ b/heat/engine/template.py @@ -19,6 +19,7 @@ import six from stevedore import extension from heat.common import exception +from heat.common.i18n import _ from heat.db import api as db_api from heat.openstack.common import log as logging diff --git a/heat/openstack/common/config/generator.py b/heat/openstack/common/config/generator.py index fc9fd084d..43113b343 100644 --- a/heat/openstack/common/config/generator.py +++ b/heat/openstack/common/config/generator.py @@ -32,6 +32,7 @@ import six import stevedore.named from heat.openstack.common import gettextutils +from heat.common import i18n from heat.openstack.common import importutils gettextutils.install('heat') diff --git a/heat/tests/__init__.py b/heat/tests/__init__.py index ad326ca74..0768bf164 100644 --- a/heat/tests/__init__.py +++ b/heat/tests/__init__.py @@ -18,9 +18,6 @@ def fake_translate_msgid(msgid, domain, desired_locale=None): return msgid i18n.enable_lazy() -# fixme(elynn): Since install() is deprecated, we should remove it in -# the future -i18n.install('heat') #To ensure messages don't really get translated while running tests. #As there are lots of places where matching is expected when comparing diff --git a/heat/tests/test_exception.py b/heat/tests/test_exception.py index e6d5cf553..b29b6a8a9 100644 --- a/heat/tests/test_exception.py +++ b/heat/tests/test_exception.py @@ -19,6 +19,7 @@ import fixtures import six from heat.common import exception +from heat.common.i18n import _ from heat.tests import common diff --git a/heat/tests/test_fault_middleware.py b/heat/tests/test_fault_middleware.py index c4f23d088..68317f4f6 100644 --- a/heat/tests/test_fault_middleware.py +++ b/heat/tests/test_fault_middleware.py @@ -21,6 +21,7 @@ from oslo.messaging._drivers import common as rpc_common import heat.api.middleware.fault as fault from heat.common import exception as heat_exc +from heat.common.i18n import _ from heat.tests.common import HeatTestCase diff --git a/heat/tests/test_function.py b/heat/tests/test_function.py index 72627a246..8522892ea 100644 --- a/heat/tests/test_function.py +++ b/heat/tests/test_function.py @@ -16,6 +16,7 @@ import six import uuid from heat.common import exception +from heat.common.i18n import _ from heat.engine.cfn import functions from heat.engine import environment from heat.engine import function diff --git a/heat/tests/test_neutron_loadbalancer.py b/heat/tests/test_neutron_loadbalancer.py index 07ac413e1..30119976c 100644 --- a/heat/tests/test_neutron_loadbalancer.py +++ b/heat/tests/test_neutron_loadbalancer.py @@ -21,6 +21,7 @@ from neutronclient.neutron import v2_0 as neutronV20 from neutronclient.v2_0 import client as neutronclient from heat.common import exception +from heat.common.i18n import _ from heat.common import template_format from heat.engine.clients.os import nova from heat.engine.resources.neutron import loadbalancer diff --git a/heat/tests/test_provider_template.py b/heat/tests/test_provider_template.py index 2bbea7495..df84a9f0a 100644 --- a/heat/tests/test_provider_template.py +++ b/heat/tests/test_provider_template.py @@ -20,6 +20,7 @@ import yaml import mock from heat.common import exception +from heat.common.i18n import _ from heat.common import template_format from heat.common import urlfetch from heat.engine import attributes diff --git a/heat/tests/test_validate.py b/heat/tests/test_validate.py index 28a33bcf8..63e67ec00 100644 --- a/heat/tests/test_validate.py +++ b/heat/tests/test_validate.py @@ -15,6 +15,7 @@ from glanceclient import exc as glance_exceptions import six from heat.common import exception +from heat.common.i18n import _ from heat.common import template_format from heat.engine.clients.os import glance from heat.engine.clients.os import nova diff --git a/tox.ini b/tox.ini index 58bb23ab3..3d8f39660 100644 --- a/tox.ini +++ b/tox.ini @@ -47,5 +47,4 @@ commands = python setup.py build_sphinx # H803 no full stop at the end of the commit message ignore = H302,H404,H803 show-source = true -builtins = _ exclude=.venv,.git,.tox,dist,*openstack/common*,*lib/python*,*egg,tools,build