From 787ba9250b3dbdd9c0c1b8ee2a4211ba124ee479 Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Sat, 28 Nov 2015 09:16:42 +0900 Subject: [PATCH] Use _i18n instead of i18n It is suggested to use _i18n.py per oslo.i18n document. http://docs.openstack.org/developer/oslo.i18n/usage.html neutronclient.i18n is now a wrapper module which emits the derecation warning. It is because might be used in implementation of the client extensions in other repositories. Closes-Bug: #1519493 Change-Id: I44969daeedc9a66dd9ad5bf80617516faf245ecc --- neutronclient/_i18n.py | 41 +++++++++++++++++++ neutronclient/client.py | 2 +- neutronclient/common/exceptions.py | 2 +- neutronclient/common/serializer.py | 2 +- neutronclient/common/utils.py | 2 +- neutronclient/common/validators.py | 2 +- neutronclient/i18n.py | 25 ++++++----- neutronclient/neutron/v2_0/__init__.py | 2 +- neutronclient/neutron/v2_0/address_scope.py | 2 +- neutronclient/neutron/v2_0/agent.py | 2 +- neutronclient/neutron/v2_0/agentscheduler.py | 2 +- .../neutron/v2_0/contrib/_fox_sockets.py | 2 +- neutronclient/neutron/v2_0/flavor/flavor.py | 2 +- .../neutron/v2_0/flavor/flavor_profile.py | 2 +- neutronclient/neutron/v2_0/floatingip.py | 2 +- neutronclient/neutron/v2_0/fw/firewall.py | 2 +- .../neutron/v2_0/fw/firewallpolicy.py | 2 +- neutronclient/neutron/v2_0/fw/firewallrule.py | 2 +- .../neutron/v2_0/lb/healthmonitor.py | 2 +- neutronclient/neutron/v2_0/lb/member.py | 2 +- neutronclient/neutron/v2_0/lb/pool.py | 2 +- .../neutron/v2_0/lb/v2/healthmonitor.py | 2 +- neutronclient/neutron/v2_0/lb/v2/listener.py | 2 +- .../neutron/v2_0/lb/v2/loadbalancer.py | 2 +- neutronclient/neutron/v2_0/lb/v2/member.py | 2 +- neutronclient/neutron/v2_0/lb/v2/pool.py | 2 +- neutronclient/neutron/v2_0/lb/vip.py | 2 +- neutronclient/neutron/v2_0/metering.py | 2 +- neutronclient/neutron/v2_0/network.py | 2 +- .../neutron/v2_0/nsx/networkgateway.py | 2 +- neutronclient/neutron/v2_0/nsx/qos_queue.py | 2 +- neutronclient/neutron/v2_0/port.py | 2 +- .../neutron/v2_0/qos/bandwidth_limit_rule.py | 2 +- neutronclient/neutron/v2_0/qos/policy.py | 2 +- neutronclient/neutron/v2_0/qos/rule.py | 2 +- neutronclient/neutron/v2_0/quota.py | 2 +- neutronclient/neutron/v2_0/rbac.py | 2 +- neutronclient/neutron/v2_0/router.py | 2 +- neutronclient/neutron/v2_0/securitygroup.py | 2 +- neutronclient/neutron/v2_0/subnet.py | 2 +- neutronclient/neutron/v2_0/subnetpool.py | 2 +- .../neutron/v2_0/vpn/endpoint_group.py | 2 +- neutronclient/neutron/v2_0/vpn/ikepolicy.py | 2 +- .../neutron/v2_0/vpn/ipsec_site_connection.py | 2 +- neutronclient/neutron/v2_0/vpn/ipsecpolicy.py | 2 +- neutronclient/neutron/v2_0/vpn/utils.py | 2 +- neutronclient/neutron/v2_0/vpn/vpnservice.py | 2 +- neutronclient/shell.py | 2 +- neutronclient/v2_0/client.py | 2 +- requirements.txt | 1 + 50 files changed, 101 insertions(+), 60 deletions(-) create mode 100644 neutronclient/_i18n.py diff --git a/neutronclient/_i18n.py b/neutronclient/_i18n.py new file mode 100644 index 000000000..f5aa76bcf --- /dev/null +++ b/neutronclient/_i18n.py @@ -0,0 +1,41 @@ +# 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 + + +DOMAIN = 'neutronclient' + +_translators = oslo_i18n.TranslatorFactory(domain=DOMAIN) + +# The primary translation function using the well-known name "_" +_ = _translators.primary + +# The contextual translation function using the name "_C" +_C = _translators.contextual_form + +# The plural translation function using the name "_P" +_P = _translators.plural_form + +# 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(DOMAIN) diff --git a/neutronclient/client.py b/neutronclient/client.py index 77076304e..445d3afb0 100644 --- a/neutronclient/client.py +++ b/neutronclient/client.py @@ -25,9 +25,9 @@ from keystoneauth1 import access from keystoneauth1 import adapter import requests +from neutronclient._i18n import _ from neutronclient.common import exceptions from neutronclient.common import utils -from neutronclient.i18n import _ _logger = logging.getLogger(__name__) diff --git a/neutronclient/common/exceptions.py b/neutronclient/common/exceptions.py index e051d5fba..95f54f722 100644 --- a/neutronclient/common/exceptions.py +++ b/neutronclient/common/exceptions.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -from neutronclient.i18n import _ +from neutronclient._i18n import _ """ Neutron base exception handling. diff --git a/neutronclient/common/serializer.py b/neutronclient/common/serializer.py index e094c2687..828e17f3a 100644 --- a/neutronclient/common/serializer.py +++ b/neutronclient/common/serializer.py @@ -18,8 +18,8 @@ import logging from oslo_serialization import jsonutils import six +from neutronclient._i18n import _ from neutronclient.common import exceptions as exception -from neutronclient.i18n import _ LOG = logging.getLogger(__name__) diff --git a/neutronclient/common/utils.py b/neutronclient/common/utils.py index 388d5e674..9c056752b 100644 --- a/neutronclient/common/utils.py +++ b/neutronclient/common/utils.py @@ -26,8 +26,8 @@ from oslo_utils import encodeutils from oslo_utils import importutils import six +from neutronclient._i18n import _ from neutronclient.common import exceptions -from neutronclient.i18n import _ def env(*vars, **kwargs): diff --git a/neutronclient/common/validators.py b/neutronclient/common/validators.py index 304ba35c5..831d68e8f 100644 --- a/neutronclient/common/validators.py +++ b/neutronclient/common/validators.py @@ -15,8 +15,8 @@ import netaddr +from neutronclient._i18n import _ from neutronclient.common import exceptions -from neutronclient.i18n import _ def validate_int_range(parsed_args, attr_name, min_value=None, max_value=None): diff --git a/neutronclient/i18n.py b/neutronclient/i18n.py index e13a880aa..776628fc7 100644 --- a/neutronclient/i18n.py +++ b/neutronclient/i18n.py @@ -10,19 +10,18 @@ # License for the specific language governing permissions and limitations # under the License. -import oslo_i18n as i18n +# TODO(amotoki): Remove this file at the beginning of Nxx cycle. -_translators = i18n.TranslatorFactory(domain='neutronclient') +from debtcollector import moves -# The primary translation function using the well-known name "_" -_ = _translators.primary +from neutronclient import _i18n -# 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 +message = ("moved to neutronclient._i18n; please migrate to local " + "oslo_i18n usage, as defined at " + "http://docs.openstack.org/developer/oslo.i18n/usage.html") + +_ = moves.moved_function(_i18n._, '_', __name__, message=message) +_LC = moves.moved_function(_i18n._LC, '_LC', __name__, message=message) +_LE = moves.moved_function(_i18n._LE, '_LE', __name__, message=message) +_LW = moves.moved_function(_i18n._LW, '_LW', __name__, message=message) +_LI = moves.moved_function(_i18n._LI, '_LI', __name__, message=message) diff --git a/neutronclient/neutron/v2_0/__init__.py b/neutronclient/neutron/v2_0/__init__.py index b34be995d..d5be4a107 100644 --- a/neutronclient/neutron/v2_0/__init__.py +++ b/neutronclient/neutron/v2_0/__init__.py @@ -27,10 +27,10 @@ from cliff import show from oslo_serialization import jsonutils import six +from neutronclient._i18n import _ from neutronclient.common import command from neutronclient.common import exceptions from neutronclient.common import utils -from neutronclient.i18n import _ HEX_ELEM = '[0-9A-Fa-f]' UUID_PATTERN = '-'.join([HEX_ELEM + '{8}', HEX_ELEM + '{4}', diff --git a/neutronclient/neutron/v2_0/address_scope.py b/neutronclient/neutron/v2_0/address_scope.py index c8517289b..a79590b1b 100755 --- a/neutronclient/neutron/v2_0/address_scope.py +++ b/neutronclient/neutron/v2_0/address_scope.py @@ -14,7 +14,7 @@ # under the License. # -from neutronclient.i18n import _ +from neutronclient._i18n import _ from neutronclient.neutron import v2_0 as neutronV20 diff --git a/neutronclient/neutron/v2_0/agent.py b/neutronclient/neutron/v2_0/agent.py index 123924c4a..7fcbdb17f 100644 --- a/neutronclient/neutron/v2_0/agent.py +++ b/neutronclient/neutron/v2_0/agent.py @@ -14,7 +14,7 @@ # under the License. # -from neutronclient.i18n import _ +from neutronclient._i18n import _ from neutronclient.neutron import v2_0 as neutronV20 diff --git a/neutronclient/neutron/v2_0/agentscheduler.py b/neutronclient/neutron/v2_0/agentscheduler.py index 59a01fbee..3348e6412 100644 --- a/neutronclient/neutron/v2_0/agentscheduler.py +++ b/neutronclient/neutron/v2_0/agentscheduler.py @@ -16,7 +16,7 @@ from __future__ import print_function -from neutronclient.i18n import _ +from neutronclient._i18n import _ from neutronclient.neutron import v2_0 as neutronV20 from neutronclient.neutron.v2_0 import network from neutronclient.neutron.v2_0 import router diff --git a/neutronclient/neutron/v2_0/contrib/_fox_sockets.py b/neutronclient/neutron/v2_0/contrib/_fox_sockets.py index c2e9b198d..1ff5ffd2b 100644 --- a/neutronclient/neutron/v2_0/contrib/_fox_sockets.py +++ b/neutronclient/neutron/v2_0/contrib/_fox_sockets.py @@ -14,8 +14,8 @@ # under the License. # +from neutronclient._i18n import _ from neutronclient.common import extension -from neutronclient.i18n import _ def _add_updatable_args(parser): diff --git a/neutronclient/neutron/v2_0/flavor/flavor.py b/neutronclient/neutron/v2_0/flavor/flavor.py index c53db3e27..30e3ae414 100644 --- a/neutronclient/neutron/v2_0/flavor/flavor.py +++ b/neutronclient/neutron/v2_0/flavor/flavor.py @@ -17,8 +17,8 @@ from __future__ import print_function import argparse +from neutronclient._i18n import _ from neutronclient.common import utils -from neutronclient.i18n import _ from neutronclient.neutron import v2_0 as neutronV20 diff --git a/neutronclient/neutron/v2_0/flavor/flavor_profile.py b/neutronclient/neutron/v2_0/flavor/flavor_profile.py index 792978782..894a8a67c 100644 --- a/neutronclient/neutron/v2_0/flavor/flavor_profile.py +++ b/neutronclient/neutron/v2_0/flavor/flavor_profile.py @@ -15,8 +15,8 @@ import argparse +from neutronclient._i18n import _ from neutronclient.common import utils -from neutronclient.i18n import _ from neutronclient.neutron import v2_0 as neutronV20 diff --git a/neutronclient/neutron/v2_0/floatingip.py b/neutronclient/neutron/v2_0/floatingip.py index 2d953554b..44b402ad0 100644 --- a/neutronclient/neutron/v2_0/floatingip.py +++ b/neutronclient/neutron/v2_0/floatingip.py @@ -18,7 +18,7 @@ from __future__ import print_function import argparse -from neutronclient.i18n import _ +from neutronclient._i18n import _ from neutronclient.neutron import v2_0 as neutronV20 diff --git a/neutronclient/neutron/v2_0/fw/firewall.py b/neutronclient/neutron/v2_0/fw/firewall.py index a4dd2ee2b..dacca9fb3 100644 --- a/neutronclient/neutron/v2_0/fw/firewall.py +++ b/neutronclient/neutron/v2_0/fw/firewall.py @@ -14,7 +14,7 @@ # under the License. # -from neutronclient.i18n import _ +from neutronclient._i18n import _ from neutronclient.neutron import v2_0 as neutronv20 diff --git a/neutronclient/neutron/v2_0/fw/firewallpolicy.py b/neutronclient/neutron/v2_0/fw/firewallpolicy.py index c0720eab5..07786879a 100644 --- a/neutronclient/neutron/v2_0/fw/firewallpolicy.py +++ b/neutronclient/neutron/v2_0/fw/firewallpolicy.py @@ -18,7 +18,7 @@ from __future__ import print_function import argparse -from neutronclient.i18n import _ +from neutronclient._i18n import _ from neutronclient.neutron import v2_0 as neutronv20 diff --git a/neutronclient/neutron/v2_0/fw/firewallrule.py b/neutronclient/neutron/v2_0/fw/firewallrule.py index 1f0536387..0f02c09f6 100644 --- a/neutronclient/neutron/v2_0/fw/firewallrule.py +++ b/neutronclient/neutron/v2_0/fw/firewallrule.py @@ -16,8 +16,8 @@ import argparse +from neutronclient._i18n import _ from neutronclient.common import utils -from neutronclient.i18n import _ from neutronclient.neutron import v2_0 as neutronv20 diff --git a/neutronclient/neutron/v2_0/lb/healthmonitor.py b/neutronclient/neutron/v2_0/lb/healthmonitor.py index 8b1a1a110..ee5d70bb5 100644 --- a/neutronclient/neutron/v2_0/lb/healthmonitor.py +++ b/neutronclient/neutron/v2_0/lb/healthmonitor.py @@ -16,7 +16,7 @@ from __future__ import print_function -from neutronclient.i18n import _ +from neutronclient._i18n import _ from neutronclient.neutron import v2_0 as neutronV20 diff --git a/neutronclient/neutron/v2_0/lb/member.py b/neutronclient/neutron/v2_0/lb/member.py index 2a5d4b1b6..d81bd69ae 100644 --- a/neutronclient/neutron/v2_0/lb/member.py +++ b/neutronclient/neutron/v2_0/lb/member.py @@ -14,7 +14,7 @@ # under the License. # -from neutronclient.i18n import _ +from neutronclient._i18n import _ from neutronclient.neutron import v2_0 as neutronV20 diff --git a/neutronclient/neutron/v2_0/lb/pool.py b/neutronclient/neutron/v2_0/lb/pool.py index b0674fcb8..aff529e02 100644 --- a/neutronclient/neutron/v2_0/lb/pool.py +++ b/neutronclient/neutron/v2_0/lb/pool.py @@ -17,7 +17,7 @@ import six -from neutronclient.i18n import _ +from neutronclient._i18n import _ from neutronclient.neutron import v2_0 as neutronV20 diff --git a/neutronclient/neutron/v2_0/lb/v2/healthmonitor.py b/neutronclient/neutron/v2_0/lb/v2/healthmonitor.py index 4b621cdff..14f9b9ac9 100644 --- a/neutronclient/neutron/v2_0/lb/v2/healthmonitor.py +++ b/neutronclient/neutron/v2_0/lb/v2/healthmonitor.py @@ -15,7 +15,7 @@ # under the License. # -from neutronclient.i18n import _ +from neutronclient._i18n import _ from neutronclient.neutron import v2_0 as neutronV20 diff --git a/neutronclient/neutron/v2_0/lb/v2/listener.py b/neutronclient/neutron/v2_0/lb/v2/listener.py index 92750ac04..4a4171908 100644 --- a/neutronclient/neutron/v2_0/lb/v2/listener.py +++ b/neutronclient/neutron/v2_0/lb/v2/listener.py @@ -15,8 +15,8 @@ # under the License. # +from neutronclient._i18n import _ from neutronclient.common import utils -from neutronclient.i18n import _ from neutronclient.neutron import v2_0 as neutronV20 diff --git a/neutronclient/neutron/v2_0/lb/v2/loadbalancer.py b/neutronclient/neutron/v2_0/lb/v2/loadbalancer.py index dc5be0061..15688c21c 100644 --- a/neutronclient/neutron/v2_0/lb/v2/loadbalancer.py +++ b/neutronclient/neutron/v2_0/lb/v2/loadbalancer.py @@ -15,7 +15,7 @@ # under the License. # -from neutronclient.i18n import _ +from neutronclient._i18n import _ from neutronclient.neutron import v2_0 as neutronV20 diff --git a/neutronclient/neutron/v2_0/lb/v2/member.py b/neutronclient/neutron/v2_0/lb/v2/member.py index 24fd27122..c1fb670f5 100644 --- a/neutronclient/neutron/v2_0/lb/v2/member.py +++ b/neutronclient/neutron/v2_0/lb/v2/member.py @@ -16,7 +16,7 @@ # under the License. # -from neutronclient.i18n import _ +from neutronclient._i18n import _ from neutronclient.neutron import v2_0 as neutronV20 diff --git a/neutronclient/neutron/v2_0/lb/v2/pool.py b/neutronclient/neutron/v2_0/lb/v2/pool.py index ca2b82bc8..3c1ea99b8 100644 --- a/neutronclient/neutron/v2_0/lb/v2/pool.py +++ b/neutronclient/neutron/v2_0/lb/v2/pool.py @@ -16,8 +16,8 @@ # under the License. # +from neutronclient._i18n import _ from neutronclient.common import utils -from neutronclient.i18n import _ from neutronclient.neutron import v2_0 as neutronV20 diff --git a/neutronclient/neutron/v2_0/lb/vip.py b/neutronclient/neutron/v2_0/lb/vip.py index 4e5d0c82b..4f51357cb 100644 --- a/neutronclient/neutron/v2_0/lb/vip.py +++ b/neutronclient/neutron/v2_0/lb/vip.py @@ -14,7 +14,7 @@ # under the License. # -from neutronclient.i18n import _ +from neutronclient._i18n import _ from neutronclient.neutron import v2_0 as neutronV20 diff --git a/neutronclient/neutron/v2_0/metering.py b/neutronclient/neutron/v2_0/metering.py index aa79ce1ef..a6ecef8e0 100644 --- a/neutronclient/neutron/v2_0/metering.py +++ b/neutronclient/neutron/v2_0/metering.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from neutronclient.i18n import _ +from neutronclient._i18n import _ from neutronclient.neutron import v2_0 as neutronv20 diff --git a/neutronclient/neutron/v2_0/network.py b/neutronclient/neutron/v2_0/network.py index 04aa9a707..8d342702d 100644 --- a/neutronclient/neutron/v2_0/network.py +++ b/neutronclient/neutron/v2_0/network.py @@ -16,9 +16,9 @@ import argparse +from neutronclient._i18n import _ from neutronclient.common import exceptions from neutronclient.common import utils -from neutronclient.i18n import _ from neutronclient.neutron import v2_0 as neutronV20 from neutronclient.neutron.v2_0 import availability_zone from neutronclient.neutron.v2_0.qos import policy as qos_policy diff --git a/neutronclient/neutron/v2_0/nsx/networkgateway.py b/neutronclient/neutron/v2_0/nsx/networkgateway.py index 515b87d6b..46d83e9a5 100644 --- a/neutronclient/neutron/v2_0/nsx/networkgateway.py +++ b/neutronclient/neutron/v2_0/nsx/networkgateway.py @@ -16,8 +16,8 @@ from __future__ import print_function +from neutronclient._i18n import _ from neutronclient.common import utils -from neutronclient.i18n import _ from neutronclient.neutron import v2_0 as neutronV20 GW_RESOURCE = 'network_gateway' diff --git a/neutronclient/neutron/v2_0/nsx/qos_queue.py b/neutronclient/neutron/v2_0/nsx/qos_queue.py index 7f6cb68b2..8ea5f1303 100644 --- a/neutronclient/neutron/v2_0/nsx/qos_queue.py +++ b/neutronclient/neutron/v2_0/nsx/qos_queue.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -from neutronclient.i18n import _ +from neutronclient._i18n import _ from neutronclient.neutron import v2_0 as neutronV20 diff --git a/neutronclient/neutron/v2_0/port.py b/neutronclient/neutron/v2_0/port.py index 49a2610c2..c611d26cf 100644 --- a/neutronclient/neutron/v2_0/port.py +++ b/neutronclient/neutron/v2_0/port.py @@ -18,9 +18,9 @@ import argparse from oslo_serialization import jsonutils +from neutronclient._i18n import _ from neutronclient.common import exceptions from neutronclient.common import utils -from neutronclient.i18n import _ from neutronclient.neutron import v2_0 as neutronV20 from neutronclient.neutron.v2_0.qos import policy as qos_policy diff --git a/neutronclient/neutron/v2_0/qos/bandwidth_limit_rule.py b/neutronclient/neutron/v2_0/qos/bandwidth_limit_rule.py index b0e1569ac..9db102f5b 100644 --- a/neutronclient/neutron/v2_0/qos/bandwidth_limit_rule.py +++ b/neutronclient/neutron/v2_0/qos/bandwidth_limit_rule.py @@ -15,8 +15,8 @@ # +from neutronclient._i18n import _ from neutronclient.common import exceptions -from neutronclient.i18n import _ from neutronclient.neutron import v2_0 as neutronv20 from neutronclient.neutron.v2_0.qos import rule as qos_rule diff --git a/neutronclient/neutron/v2_0/qos/policy.py b/neutronclient/neutron/v2_0/qos/policy.py index 8d6035627..047888aa8 100755 --- a/neutronclient/neutron/v2_0/qos/policy.py +++ b/neutronclient/neutron/v2_0/qos/policy.py @@ -16,7 +16,7 @@ import os -from neutronclient.i18n import _ +from neutronclient._i18n import _ from neutronclient.neutron import v2_0 as neutronv20 diff --git a/neutronclient/neutron/v2_0/qos/rule.py b/neutronclient/neutron/v2_0/qos/rule.py index 3b6510d17..e4c8d9260 100644 --- a/neutronclient/neutron/v2_0/qos/rule.py +++ b/neutronclient/neutron/v2_0/qos/rule.py @@ -15,7 +15,7 @@ # -from neutronclient.i18n import _ +from neutronclient._i18n import _ from neutronclient.neutron import v2_0 as neutronv20 from neutronclient.neutron.v2_0.qos import policy as qos_policy diff --git a/neutronclient/neutron/v2_0/quota.py b/neutronclient/neutron/v2_0/quota.py index 7346f54b8..4b6e86e0b 100644 --- a/neutronclient/neutron/v2_0/quota.py +++ b/neutronclient/neutron/v2_0/quota.py @@ -23,9 +23,9 @@ from cliff import show from oslo_serialization import jsonutils import six +from neutronclient._i18n import _ from neutronclient.common import exceptions from neutronclient.common import utils -from neutronclient.i18n import _ from neutronclient.neutron import v2_0 as neutronV20 diff --git a/neutronclient/neutron/v2_0/rbac.py b/neutronclient/neutron/v2_0/rbac.py index 79c991d12..d840af5b1 100644 --- a/neutronclient/neutron/v2_0/rbac.py +++ b/neutronclient/neutron/v2_0/rbac.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -from neutronclient.i18n import _ +from neutronclient._i18n import _ from neutronclient.neutron import v2_0 as neutronV20 diff --git a/neutronclient/neutron/v2_0/router.py b/neutronclient/neutron/v2_0/router.py index bcb4ae3c7..955c7b802 100644 --- a/neutronclient/neutron/v2_0/router.py +++ b/neutronclient/neutron/v2_0/router.py @@ -20,9 +20,9 @@ import argparse from oslo_serialization import jsonutils +from neutronclient._i18n import _ from neutronclient.common import exceptions from neutronclient.common import utils -from neutronclient.i18n import _ from neutronclient.neutron import v2_0 as neutronV20 from neutronclient.neutron.v2_0 import availability_zone diff --git a/neutronclient/neutron/v2_0/securitygroup.py b/neutronclient/neutron/v2_0/securitygroup.py index 4891a1576..22ff9fc8e 100644 --- a/neutronclient/neutron/v2_0/securitygroup.py +++ b/neutronclient/neutron/v2_0/securitygroup.py @@ -16,8 +16,8 @@ import argparse +from neutronclient._i18n import _ from neutronclient.common import exceptions -from neutronclient.i18n import _ from neutronclient.neutron import v2_0 as neutronV20 diff --git a/neutronclient/neutron/v2_0/subnet.py b/neutronclient/neutron/v2_0/subnet.py index 07da46b9a..d8b594663 100644 --- a/neutronclient/neutron/v2_0/subnet.py +++ b/neutronclient/neutron/v2_0/subnet.py @@ -18,9 +18,9 @@ import argparse from oslo_serialization import jsonutils +from neutronclient._i18n import _ from neutronclient.common import exceptions from neutronclient.common import utils -from neutronclient.i18n import _ from neutronclient.neutron import v2_0 as neutronV20 diff --git a/neutronclient/neutron/v2_0/subnetpool.py b/neutronclient/neutron/v2_0/subnetpool.py index 2357750bc..8677cd5c5 100644 --- a/neutronclient/neutron/v2_0/subnetpool.py +++ b/neutronclient/neutron/v2_0/subnetpool.py @@ -14,7 +14,7 @@ # under the License. # -from neutronclient.i18n import _ +from neutronclient._i18n import _ from neutronclient.neutron import v2_0 as neutronV20 diff --git a/neutronclient/neutron/v2_0/vpn/endpoint_group.py b/neutronclient/neutron/v2_0/vpn/endpoint_group.py index e28e167fa..a112b315e 100644 --- a/neutronclient/neutron/v2_0/vpn/endpoint_group.py +++ b/neutronclient/neutron/v2_0/vpn/endpoint_group.py @@ -14,7 +14,7 @@ # under the License. # -from neutronclient.i18n import _ +from neutronclient._i18n import _ from neutronclient.neutron import v2_0 as neutronv20 diff --git a/neutronclient/neutron/v2_0/vpn/ikepolicy.py b/neutronclient/neutron/v2_0/vpn/ikepolicy.py index dcfad483c..e771aadaf 100644 --- a/neutronclient/neutron/v2_0/vpn/ikepolicy.py +++ b/neutronclient/neutron/v2_0/vpn/ikepolicy.py @@ -14,8 +14,8 @@ # under the License. # +from neutronclient._i18n import _ from neutronclient.common import utils -from neutronclient.i18n import _ from neutronclient.neutron import v2_0 as neutronv20 from neutronclient.neutron.v2_0.vpn import utils as vpn_utils diff --git a/neutronclient/neutron/v2_0/vpn/ipsec_site_connection.py b/neutronclient/neutron/v2_0/vpn/ipsec_site_connection.py index 8dfa4f38e..8726c28ac 100644 --- a/neutronclient/neutron/v2_0/vpn/ipsec_site_connection.py +++ b/neutronclient/neutron/v2_0/vpn/ipsec_site_connection.py @@ -16,9 +16,9 @@ from oslo_serialization import jsonutils +from neutronclient._i18n import _ from neutronclient.common import exceptions from neutronclient.common import utils -from neutronclient.i18n import _ from neutronclient.neutron import v2_0 as neutronv20 from neutronclient.neutron.v2_0.vpn import utils as vpn_utils diff --git a/neutronclient/neutron/v2_0/vpn/ipsecpolicy.py b/neutronclient/neutron/v2_0/vpn/ipsecpolicy.py index 138c941d3..80a334da6 100644 --- a/neutronclient/neutron/v2_0/vpn/ipsecpolicy.py +++ b/neutronclient/neutron/v2_0/vpn/ipsecpolicy.py @@ -14,8 +14,8 @@ # under the License. # +from neutronclient._i18n import _ from neutronclient.common import utils -from neutronclient.i18n import _ from neutronclient.neutron import v2_0 as neutronv20 from neutronclient.neutron.v2_0.vpn import utils as vpn_utils diff --git a/neutronclient/neutron/v2_0/vpn/utils.py b/neutronclient/neutron/v2_0/vpn/utils.py index ab6760793..65d9c7c4b 100644 --- a/neutronclient/neutron/v2_0/vpn/utils.py +++ b/neutronclient/neutron/v2_0/vpn/utils.py @@ -18,8 +18,8 @@ """VPN Utilities and helper functions.""" +from neutronclient._i18n import _ from neutronclient.common import exceptions -from neutronclient.i18n import _ dpd_supported_actions = ['hold', 'clear', 'restart', 'restart-by-peer', 'disabled'] diff --git a/neutronclient/neutron/v2_0/vpn/vpnservice.py b/neutronclient/neutron/v2_0/vpn/vpnservice.py index c18f4e7e6..8bd2198c9 100644 --- a/neutronclient/neutron/v2_0/vpn/vpnservice.py +++ b/neutronclient/neutron/v2_0/vpn/vpnservice.py @@ -14,7 +14,7 @@ # under the License. # -from neutronclient.i18n import _ +from neutronclient._i18n import _ from neutronclient.neutron import v2_0 as neutronv20 diff --git a/neutronclient/shell.py b/neutronclient/shell.py index b4ddfbf7a..8c92c4b7f 100644 --- a/neutronclient/shell.py +++ b/neutronclient/shell.py @@ -34,12 +34,12 @@ from oslo_utils import encodeutils from cliff import app from cliff import commandmanager +from neutronclient._i18n import _ from neutronclient.common import clientmanager from neutronclient.common import command as openstack_command from neutronclient.common import exceptions as exc from neutronclient.common import extension as client_extension from neutronclient.common import utils -from neutronclient.i18n import _ from neutronclient.neutron.v2_0 import address_scope from neutronclient.neutron.v2_0 import agent from neutronclient.neutron.v2_0 import agentscheduler diff --git a/neutronclient/v2_0/client.py b/neutronclient/v2_0/client.py index 324fd1219..d69bcca32 100644 --- a/neutronclient/v2_0/client.py +++ b/neutronclient/v2_0/client.py @@ -23,12 +23,12 @@ import time import requests import six.moves.urllib.parse as urlparse +from neutronclient._i18n import _ from neutronclient import client from neutronclient.common import exceptions from neutronclient.common import extension as client_extension from neutronclient.common import serializer from neutronclient.common import utils -from neutronclient.i18n import _ _logger = logging.getLogger(__name__) diff --git a/requirements.txt b/requirements.txt index e46d19284..be8fb03d0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,6 +4,7 @@ pbr>=1.6 argparse cliff>=1.15.0 # Apache-2.0 +debtcollector>=0.3.0 # Apache-2.0 iso8601>=0.1.9 netaddr!=0.7.16,>=0.7.12 oslo.i18n>=1.5.0 # Apache-2.0