From 72111bbe51bebd500ddfb3db070943b1d1e96c99 Mon Sep 17 00:00:00 2001
From: hexiang zhang <zhang.hexiang@99cloud.net>
Date: Fri, 12 Jul 2019 17:34:45 +0800
Subject: [PATCH] from i18n import _ when quoting them

Change-Id: Ic40decb87f3e569953e2d1586449893eea897410
Closes-Bug:#1836342
---
 tacker/agent/linux/utils.py                               | 1 +
 tacker/alarm_receiver.py                                  | 1 +
 tacker/api/api_common.py                                  | 1 +
 tacker/api/extensions.py                                  | 1 +
 tacker/api/v1/attributes.py                               | 1 +
 tacker/api/v1/base.py                                     | 1 +
 tacker/api/versions.py                                    | 1 +
 tacker/cmd/eventlet/tacker_server.py                      | 1 +
 tacker/common/config.py                                   | 1 +
 tacker/common/driver_manager.py                           | 2 ++
 tacker/db/db_base.py                                      | 1 +
 tacker/db/migration/cli.py                                | 1 +
 tacker/db/migration/purge_tables.py                       | 1 +
 tacker/db/sqlalchemyutils.py                              | 1 +
 tacker/db/vnfm/vnfm_db.py                                 | 1 +
 tacker/extensions/common_services.py                      | 1 +
 tacker/extensions/nfvo_plugins/network_service.py         | 1 +
 tacker/extensions/vnfm.py                                 | 1 +
 tacker/manager.py                                         | 1 +
 tacker/plugins/common/utils.py                            | 1 +
 tacker/service.py                                         | 1 +
 tacker/tests/unit/api/v1/test_attributes.py               | 1 +
 tacker/tests/unit/api/v1/test_resource.py                 | 1 +
 tacker/tests/unit/vnfm/test_plugin.py                     | 1 +
 tacker/tosca/utils.py                                     | 2 ++
 tacker/vnfm/infra_drivers/kubernetes/kubernetes_driver.py | 1 +
 tacker/vnfm/infra_drivers/openstack/openstack.py          | 1 +
 tacker/vnfm/infra_drivers/openstack/translate_template.py | 1 +
 tacker/vnfm/mgmt_drivers/openwrt/openwrt.py               | 1 +
 tacker/vnfm/monitor.py                                    | 1 +
 tacker/vnfm/monitor_drivers/ceilometer/ceilometer.py      | 1 +
 tacker/vnfm/monitor_drivers/http_ping/http_ping.py        | 1 +
 tacker/vnfm/monitor_drivers/ping/ping.py                  | 1 +
 tacker/vnfm/plugin.py                                     | 1 +
 tacker/wsgi.py                                            | 1 +
 35 files changed, 37 insertions(+)

diff --git a/tacker/agent/linux/utils.py b/tacker/agent/linux/utils.py
index 9a861c7dd..a9f75f803 100644
--- a/tacker/agent/linux/utils.py
+++ b/tacker/agent/linux/utils.py
@@ -21,6 +21,7 @@ from eventlet import greenthread
 from oslo_log import log as logging
 from oslo_utils import excutils
 
+from tacker._i18n import _
 from tacker.common import utils
 
 
diff --git a/tacker/alarm_receiver.py b/tacker/alarm_receiver.py
index 3137b0ef7..20e9f6d73 100644
--- a/tacker/alarm_receiver.py
+++ b/tacker/alarm_receiver.py
@@ -15,6 +15,7 @@ from oslo_config import cfg
 from oslo_log import log as logging
 from oslo_serialization import jsonutils
 from six.moves.urllib import parse
+from tacker._i18n import _
 from tacker.vnfm.monitor_drivers.token import Token
 from tacker import wsgi
 # check alarm url with db --> move to plugin
diff --git a/tacker/api/api_common.py b/tacker/api/api_common.py
index 777646140..d35b7d554 100644
--- a/tacker/api/api_common.py
+++ b/tacker/api/api_common.py
@@ -22,6 +22,7 @@ from six import iteritems
 from six.moves.urllib import parse as urllib_parse
 from webob import exc
 
+from tacker._i18n import _
 from tacker.common import constants
 from tacker.common import exceptions
 from tacker import wsgi
diff --git a/tacker/api/extensions.py b/tacker/api/extensions.py
index 3f0e36b1f..102dcf7d0 100644
--- a/tacker/api/extensions.py
+++ b/tacker/api/extensions.py
@@ -25,6 +25,7 @@ import six
 import webob.dec
 import webob.exc
 
+from tacker._i18n import _
 from tacker.common import exceptions
 import tacker.extensions
 from tacker import policy
diff --git a/tacker/api/v1/attributes.py b/tacker/api/v1/attributes.py
index fd10c9baa..148b362f8 100644
--- a/tacker/api/v1/attributes.py
+++ b/tacker/api/v1/attributes.py
@@ -20,6 +20,7 @@ from oslo_log import log as logging
 from oslo_utils import uuidutils
 import six
 
+from tacker._i18n import _
 from tacker.common import exceptions as n_exc
 
 
diff --git a/tacker/api/v1/base.py b/tacker/api/v1/base.py
index 885eb7bac..ac54d48b5 100644
--- a/tacker/api/v1/base.py
+++ b/tacker/api/v1/base.py
@@ -19,6 +19,7 @@ import webob.exc
 from oslo_log import log as logging
 from oslo_utils import strutils
 
+from tacker._i18n import _
 from tacker.api import api_common
 from tacker.api.v1 import attributes
 from tacker.api.v1 import resource as wsgi_resource
diff --git a/tacker/api/versions.py b/tacker/api/versions.py
index d29cd6bcc..63ca60011 100644
--- a/tacker/api/versions.py
+++ b/tacker/api/versions.py
@@ -17,6 +17,7 @@ import webob.dec
 
 import oslo_i18n
 
+from tacker._i18n import _
 from tacker.api.views import versions as versions_view
 from tacker import wsgi
 
diff --git a/tacker/cmd/eventlet/tacker_server.py b/tacker/cmd/eventlet/tacker_server.py
index 4d35a6322..1d120957d 100644
--- a/tacker/cmd/eventlet/tacker_server.py
+++ b/tacker/cmd/eventlet/tacker_server.py
@@ -24,6 +24,7 @@ from oslo_config import cfg
 import oslo_i18n
 from oslo_service import service as common_service
 
+from tacker._i18n import _
 from tacker.common import config
 from tacker import objects
 from tacker import service
diff --git a/tacker/common/config.py b/tacker/common/config.py
index 720a3aba9..cb1bf06a8 100644
--- a/tacker/common/config.py
+++ b/tacker/common/config.py
@@ -25,6 +25,7 @@ from oslo_log import log as logging
 import oslo_messaging
 from paste import deploy
 
+from tacker._i18n import _
 from tacker.common import utils
 from tacker import version
 
diff --git a/tacker/common/driver_manager.py b/tacker/common/driver_manager.py
index f7c3eef70..6feb68d62 100644
--- a/tacker/common/driver_manager.py
+++ b/tacker/common/driver_manager.py
@@ -19,6 +19,8 @@ from oslo_log import log as logging
 
 import stevedore.named
 
+from tacker._i18n import _
+
 LOG = logging.getLogger(__name__)
 
 
diff --git a/tacker/db/db_base.py b/tacker/db/db_base.py
index 0a89db907..0f51dd51a 100644
--- a/tacker/db/db_base.py
+++ b/tacker/db/db_base.py
@@ -22,6 +22,7 @@ from six import iteritems
 from sqlalchemy.orm import exc as orm_exc
 from sqlalchemy import sql
 
+from tacker._i18n import _
 from tacker.common import exceptions as n_exc
 from tacker.db import sqlalchemyutils
 
diff --git a/tacker/db/migration/cli.py b/tacker/db/migration/cli.py
index 70b506b84..8aa022b16 100644
--- a/tacker/db/migration/cli.py
+++ b/tacker/db/migration/cli.py
@@ -20,6 +20,7 @@ from alembic import script as alembic_script
 from alembic import util as alembic_util
 from oslo_config import cfg
 
+from tacker._i18n import _
 from tacker.db.migration.models import head  # noqa
 from tacker.db.migration import purge_tables
 
diff --git a/tacker/db/migration/purge_tables.py b/tacker/db/migration/purge_tables.py
index 595fa53a4..4e0a90050 100644
--- a/tacker/db/migration/purge_tables.py
+++ b/tacker/db/migration/purge_tables.py
@@ -21,6 +21,7 @@ from sqlalchemy import inspect
 
 from oslo_utils import timeutils
 
+from tacker._i18n import _
 from tacker.common import exceptions
 
 
diff --git a/tacker/db/sqlalchemyutils.py b/tacker/db/sqlalchemyutils.py
index 13ce6a641..9ddb82cc2 100644
--- a/tacker/db/sqlalchemyutils.py
+++ b/tacker/db/sqlalchemyutils.py
@@ -17,6 +17,7 @@ from six import moves
 import sqlalchemy
 from sqlalchemy.orm.properties import RelationshipProperty
 
+from tacker._i18n import _
 from tacker.common import exceptions as n_exc
 
 
diff --git a/tacker/db/vnfm/vnfm_db.py b/tacker/db/vnfm/vnfm_db.py
index 5e1299cb3..6c95fbfdb 100644
--- a/tacker/db/vnfm/vnfm_db.py
+++ b/tacker/db/vnfm/vnfm_db.py
@@ -26,6 +26,7 @@ from sqlalchemy import orm
 from sqlalchemy.orm import exc as orm_exc
 from sqlalchemy import schema
 
+from tacker._i18n import _
 from tacker.api.v1 import attributes
 from tacker.common import exceptions
 from tacker import context as t_context
diff --git a/tacker/extensions/common_services.py b/tacker/extensions/common_services.py
index 37b838e0d..b31d49de6 100644
--- a/tacker/extensions/common_services.py
+++ b/tacker/extensions/common_services.py
@@ -17,6 +17,7 @@ import abc
 
 import six
 
+from tacker._i18n import _
 from tacker.api import extensions
 from tacker.api.v1 import attributes as attr
 from tacker.api.v1 import resource_helper
diff --git a/tacker/extensions/nfvo_plugins/network_service.py b/tacker/extensions/nfvo_plugins/network_service.py
index 5b4abf72f..65321180b 100644
--- a/tacker/extensions/nfvo_plugins/network_service.py
+++ b/tacker/extensions/nfvo_plugins/network_service.py
@@ -13,6 +13,7 @@
 import abc
 import six
 
+from tacker._i18n import _
 from tacker.common import exceptions
 from tacker.services import service_base
 
diff --git a/tacker/extensions/vnfm.py b/tacker/extensions/vnfm.py
index 644c569ce..1a01efa58 100644
--- a/tacker/extensions/vnfm.py
+++ b/tacker/extensions/vnfm.py
@@ -18,6 +18,7 @@ import abc
 from oslo_log import log as logging
 import six
 
+from tacker._i18n import _
 from tacker.api import extensions
 from tacker.api.v1 import attributes as attr
 from tacker.api.v1 import base
diff --git a/tacker/manager.py b/tacker/manager.py
index 35f68a155..387fe1997 100644
--- a/tacker/manager.py
+++ b/tacker/manager.py
@@ -18,6 +18,7 @@ from oslo_log import log as logging
 import oslo_messaging
 from oslo_service import periodic_task
 
+from tacker._i18n import _
 from tacker.common import utils
 
 
diff --git a/tacker/plugins/common/utils.py b/tacker/plugins/common/utils.py
index 70451c7df..dfdff5d7c 100644
--- a/tacker/plugins/common/utils.py
+++ b/tacker/plugins/common/utils.py
@@ -16,6 +16,7 @@
 Common utilities and helper functions for Openstack Networking Plugins.
 """
 
+from tacker._i18n import _
 from tacker.common import exceptions as n_exc
 from tacker.common import utils
 from tacker.plugins.common import constants
diff --git a/tacker/service.py b/tacker/service.py
index c8ce8bf37..453c66aa5 100644
--- a/tacker/service.py
+++ b/tacker/service.py
@@ -26,6 +26,7 @@ from oslo_service import service
 from oslo_utils import excutils
 from oslo_utils import importutils
 
+from tacker._i18n import _
 from tacker.common import config
 from tacker.common import rpc as n_rpc
 from tacker import context
diff --git a/tacker/tests/unit/api/v1/test_attributes.py b/tacker/tests/unit/api/v1/test_attributes.py
index 307c40246..83a93d59b 100644
--- a/tacker/tests/unit/api/v1/test_attributes.py
+++ b/tacker/tests/unit/api/v1/test_attributes.py
@@ -15,6 +15,7 @@
 
 import testtools
 
+from tacker._i18n import _
 from tacker.api.v1 import attributes
 from tacker.common import exceptions as n_exc
 from tacker.tests import base
diff --git a/tacker/tests/unit/api/v1/test_resource.py b/tacker/tests/unit/api/v1/test_resource.py
index 8ce3db1b6..bafc72f5b 100644
--- a/tacker/tests/unit/api/v1/test_resource.py
+++ b/tacker/tests/unit/api/v1/test_resource.py
@@ -17,6 +17,7 @@ import mock
 from webob import exc
 import webtest
 
+from tacker._i18n import _
 from tacker.api.v1 import resource as wsgi_resource
 from tacker.common import exceptions as n_exc
 from tacker import context
diff --git a/tacker/tests/unit/vnfm/test_plugin.py b/tacker/tests/unit/vnfm/test_plugin.py
index ab5462c7a..d73eb1a7e 100644
--- a/tacker/tests/unit/vnfm/test_plugin.py
+++ b/tacker/tests/unit/vnfm/test_plugin.py
@@ -20,6 +20,7 @@ from mock import patch
 from oslo_utils import uuidutils
 import yaml
 
+from tacker._i18n import _
 from tacker.common import exceptions
 from tacker import context
 from tacker.db.common_services import common_services_db_plugin
diff --git a/tacker/tosca/utils.py b/tacker/tosca/utils.py
index e98e56dad..7435db7ae 100644
--- a/tacker/tosca/utils.py
+++ b/tacker/tosca/utils.py
@@ -20,6 +20,8 @@ import yaml
 from collections import OrderedDict
 from oslo_log import log as logging
 from oslo_utils import uuidutils
+
+from tacker._i18n import _
 from tacker.common import exceptions
 from tacker.common import log
 from tacker.common import utils
diff --git a/tacker/vnfm/infra_drivers/kubernetes/kubernetes_driver.py b/tacker/vnfm/infra_drivers/kubernetes/kubernetes_driver.py
index 8097db19e..c1adc1eaa 100644
--- a/tacker/vnfm/infra_drivers/kubernetes/kubernetes_driver.py
+++ b/tacker/vnfm/infra_drivers/kubernetes/kubernetes_driver.py
@@ -21,6 +21,7 @@ from oslo_config import cfg
 from oslo_log import log as logging
 from oslo_serialization import jsonutils
 
+from tacker._i18n import _
 from tacker.common.container import kubernetes_utils
 from tacker.common import log
 from tacker.common import utils
diff --git a/tacker/vnfm/infra_drivers/openstack/openstack.py b/tacker/vnfm/infra_drivers/openstack/openstack.py
index 4dc21ed5d..ba702ee84 100644
--- a/tacker/vnfm/infra_drivers/openstack/openstack.py
+++ b/tacker/vnfm/infra_drivers/openstack/openstack.py
@@ -21,6 +21,7 @@ from oslo_log import log as logging
 from oslo_serialization import jsonutils
 import yaml
 
+from tacker._i18n import _
 from tacker.common import log
 from tacker.common import utils
 from tacker.extensions import vnfm
diff --git a/tacker/vnfm/infra_drivers/openstack/translate_template.py b/tacker/vnfm/infra_drivers/openstack/translate_template.py
index 16f6cbff9..cb9db9097 100644
--- a/tacker/vnfm/infra_drivers/openstack/translate_template.py
+++ b/tacker/vnfm/infra_drivers/openstack/translate_template.py
@@ -19,6 +19,7 @@ from toscaparser.utils import yamlparser
 from translator.hot import tosca_translator
 import yaml
 
+from tacker._i18n import _
 from tacker.common import exceptions
 from tacker.common import log
 from tacker.extensions import common_services as cs
diff --git a/tacker/vnfm/mgmt_drivers/openwrt/openwrt.py b/tacker/vnfm/mgmt_drivers/openwrt/openwrt.py
index 20d332630..1aeafcb30 100644
--- a/tacker/vnfm/mgmt_drivers/openwrt/openwrt.py
+++ b/tacker/vnfm/mgmt_drivers/openwrt/openwrt.py
@@ -19,6 +19,7 @@ from oslo_log import log as logging
 from oslo_serialization import jsonutils
 import yaml
 
+from tacker._i18n import _
 from tacker.common import cmd_executer
 from tacker.common import exceptions
 from tacker.common import log
diff --git a/tacker/vnfm/monitor.py b/tacker/vnfm/monitor.py
index 829dd19c3..2b9b5dfb4 100644
--- a/tacker/vnfm/monitor.py
+++ b/tacker/vnfm/monitor.py
@@ -25,6 +25,7 @@ from oslo_log import log as logging
 from oslo_serialization import jsonutils
 from oslo_utils import timeutils
 
+from tacker._i18n import _
 from tacker.common import driver_manager
 from tacker.common import exceptions
 from tacker import context as t_context
diff --git a/tacker/vnfm/monitor_drivers/ceilometer/ceilometer.py b/tacker/vnfm/monitor_drivers/ceilometer/ceilometer.py
index 9d6dcc79a..32bfd8ff1 100644
--- a/tacker/vnfm/monitor_drivers/ceilometer/ceilometer.py
+++ b/tacker/vnfm/monitor_drivers/ceilometer/ceilometer.py
@@ -18,6 +18,7 @@ from oslo_config import cfg
 from oslo_log import log as logging
 import random
 import string
+from tacker._i18n import _
 from tacker.common import utils
 from tacker.vnfm.monitor_drivers import abstract_driver
 
diff --git a/tacker/vnfm/monitor_drivers/http_ping/http_ping.py b/tacker/vnfm/monitor_drivers/http_ping/http_ping.py
index 38e176e61..7403dbbb0 100644
--- a/tacker/vnfm/monitor_drivers/http_ping/http_ping.py
+++ b/tacker/vnfm/monitor_drivers/http_ping/http_ping.py
@@ -19,6 +19,7 @@ from oslo_log import log as logging
 import six.moves.urllib.error as urlerr
 import six.moves.urllib.request as urlreq
 
+from tacker._i18n import _
 from tacker.common import log
 from tacker.vnfm.monitor_drivers import abstract_driver
 
diff --git a/tacker/vnfm/monitor_drivers/ping/ping.py b/tacker/vnfm/monitor_drivers/ping/ping.py
index a4ce16907..812e25d08 100644
--- a/tacker/vnfm/monitor_drivers/ping/ping.py
+++ b/tacker/vnfm/monitor_drivers/ping/ping.py
@@ -17,6 +17,7 @@ import netaddr
 from oslo_config import cfg
 from oslo_log import log as logging
 
+from tacker._i18n import _
 from tacker.agent.linux import utils as linux_utils
 from tacker.common import log
 from tacker.vnfm.monitor_drivers import abstract_driver
diff --git a/tacker/vnfm/plugin.py b/tacker/vnfm/plugin.py
index ae961e7c8..0fc018565 100644
--- a/tacker/vnfm/plugin.py
+++ b/tacker/vnfm/plugin.py
@@ -25,6 +25,7 @@ from oslo_utils import excutils
 from oslo_utils import uuidutils
 from toscaparser.tosca_template import ToscaTemplate
 
+from tacker._i18n import _
 from tacker.api.v1 import attributes
 from tacker.common import driver_manager
 from tacker.common import exceptions
diff --git a/tacker/wsgi.py b/tacker/wsgi.py
index e276023e3..c7e792ae2 100644
--- a/tacker/wsgi.py
+++ b/tacker/wsgi.py
@@ -40,6 +40,7 @@ import six
 import webob.dec
 import webob.exc
 
+from tacker._i18n import _
 from tacker.common import exceptions as exception
 from tacker import context
 from tacker.db import api