From 02c108fd0010798927f144b1dfee9f4ec1947f41 Mon Sep 17 00:00:00 2001 From: Hideki Saito Date: Sat, 8 Nov 2014 21:13:45 +0900 Subject: [PATCH] Fix mixed usage of _ * all modules are using function of _ from oslo.i18n * remove the definition of _ from openstack.common.__init__.py for safety Change-Id: Ice2f8be1190fd13e8991a8c7fa55ca636341e875 Closes-Bug: #1382476 --- neutronclient/common/__init__.py | 26 -------------------------- neutronclient/common/exceptions.py | 2 +- neutronclient/common/utils.py | 2 +- neutronclient/v2_0/client.py | 2 +- 4 files changed, 3 insertions(+), 29 deletions(-) diff --git a/neutronclient/common/__init__.py b/neutronclient/common/__init__.py index fb715cf..e69de29 100644 --- a/neutronclient/common/__init__.py +++ b/neutronclient/common/__init__.py @@ -1,26 +0,0 @@ -# Copyright 2011 VMware, Inc. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -import gettext - -t = gettext.translation('neutronclient', fallback=True) -try: - ugettext = t.ugettext # Python 2 -except AttributeError: - ugettext = t.gettext # Python 3 - - -def _(msg): - return ugettext(msg) diff --git a/neutronclient/common/exceptions.py b/neutronclient/common/exceptions.py index 4c7c9d8..9728fbd 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.common import _ +from neutronclient.i18n import _ """ Neutron base exception handling. diff --git a/neutronclient/common/utils.py b/neutronclient/common/utils.py index 28137b7..d82e34b 100644 --- a/neutronclient/common/utils.py +++ b/neutronclient/common/utils.py @@ -24,8 +24,8 @@ from oslo.utils import encodeutils from oslo.utils import importutils import six -from neutronclient.common import _ from neutronclient.common import exceptions +from neutronclient.i18n import _ def env(*vars, **kwargs): diff --git a/neutronclient/v2_0/client.py b/neutronclient/v2_0/client.py index d2bb2ed..44035b6 100644 --- a/neutronclient/v2_0/client.py +++ b/neutronclient/v2_0/client.py @@ -21,11 +21,11 @@ import requests import six.moves.urllib.parse as urlparse from neutronclient import client -from neutronclient.common import _ from neutronclient.common import constants from neutronclient.common import exceptions from neutronclient.common import serializer from neutronclient.common import utils +from neutronclient.i18n import _ _logger = logging.getLogger(__name__)