From ed0382b2bed0b84c0bf5c6b02e07ef1ae671b5ad Mon Sep 17 00:00:00 2001
From: Ihar Hrachyshka <ihrachys@redhat.com>
Date: Fri, 21 Nov 2014 22:01:08 +0100
Subject: [PATCH] Migrate to oslo.i18n

Mostly trivial import changes.

- oslo.i18n no longer provide install() method to inject _() into
  globals(), so removed all calls to it;
- removed Babel from dependencies (it will now be grabbed by oslo.i18n);
- updated tox.ini to ignore import violations for oslo.i18n.

Change-Id: I6623d551f512fb7fe9bf35ee734ed6d4c6cbc287
---
 neutron/db/vpn/vpn_db.py                                     | 2 +-
 neutron/services/vpn/device_drivers/cisco_csr_rest_client.py | 2 +-
 neutron/services/vpn/device_drivers/cisco_ipsec.py           | 2 +-
 neutron/services/vpn/device_drivers/ipsec.py                 | 2 +-
 neutron/services/vpn/plugin.py                               | 2 +-
 neutron/services/vpn/service_drivers/cisco_csr_db.py         | 2 +-
 openstack-common.conf                                        | 1 -
 requirements.txt                                             | 1 -
 tox.ini                                                      | 2 +-
 9 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/neutron/db/vpn/vpn_db.py b/neutron/db/vpn/vpn_db.py
index c32f98486..0dec4a587 100644
--- a/neutron/db/vpn/vpn_db.py
+++ b/neutron/db/vpn/vpn_db.py
@@ -27,8 +27,8 @@ from neutron.db import model_base
 from neutron.db import models_v2
 from neutron.db.vpn import vpn_validator
 from neutron.extensions import vpnaas
+from neutron.i18n import _LW
 from neutron import manager
-from neutron.openstack.common.gettextutils import _LW
 from neutron.openstack.common import log as logging
 from neutron.openstack.common import uuidutils
 from neutron.plugins.common import constants
diff --git a/neutron/services/vpn/device_drivers/cisco_csr_rest_client.py b/neutron/services/vpn/device_drivers/cisco_csr_rest_client.py
index de5d47b3f..04e6c092a 100644
--- a/neutron/services/vpn/device_drivers/cisco_csr_rest_client.py
+++ b/neutron/services/vpn/device_drivers/cisco_csr_rest_client.py
@@ -19,7 +19,7 @@ from oslo.serialization import jsonutils
 import requests
 from requests import exceptions as r_exc
 
-from neutron.openstack.common.gettextutils import _LE, _LW
+from neutron.i18n import _LE, _LW
 from neutron.openstack.common import log as logging
 
 
diff --git a/neutron/services/vpn/device_drivers/cisco_ipsec.py b/neutron/services/vpn/device_drivers/cisco_ipsec.py
index 7776a3457..b4b3d93c8 100644
--- a/neutron/services/vpn/device_drivers/cisco_ipsec.py
+++ b/neutron/services/vpn/device_drivers/cisco_ipsec.py
@@ -23,7 +23,7 @@ import six
 from neutron.common import exceptions
 from neutron.common import rpc as n_rpc
 from neutron import context as ctx
-from neutron.openstack.common.gettextutils import _LE, _LI, _LW
+from neutron.i18n import _LE, _LI, _LW
 from neutron.openstack.common import lockutils
 from neutron.openstack.common import log as logging
 from neutron.openstack.common import loopingcall
diff --git a/neutron/services/vpn/device_drivers/ipsec.py b/neutron/services/vpn/device_drivers/ipsec.py
index fb393c1b0..3afd3b7ca 100644
--- a/neutron/services/vpn/device_drivers/ipsec.py
+++ b/neutron/services/vpn/device_drivers/ipsec.py
@@ -28,7 +28,7 @@ from neutron.agent.linux import ip_lib
 from neutron.agent.linux import utils
 from neutron.common import rpc as n_rpc
 from neutron import context
-from neutron.openstack.common.gettextutils import _LE
+from neutron.i18n import _LE
 from neutron.openstack.common import lockutils
 from neutron.openstack.common import log as logging
 from neutron.openstack.common import loopingcall
diff --git a/neutron/services/vpn/plugin.py b/neutron/services/vpn/plugin.py
index c26038610..dd8a20bf1 100644
--- a/neutron/services/vpn/plugin.py
+++ b/neutron/services/vpn/plugin.py
@@ -15,7 +15,7 @@
 #    under the License.
 
 from neutron.db.vpn import vpn_db
-from neutron.openstack.common.gettextutils import _LI
+from neutron.i18n import _LI
 from neutron.openstack.common import log as logging
 from neutron.plugins.common import constants
 from neutron.services import service_base
diff --git a/neutron/services/vpn/service_drivers/cisco_csr_db.py b/neutron/services/vpn/service_drivers/cisco_csr_db.py
index 37f9a8490..1b501f118 100644
--- a/neutron/services/vpn/service_drivers/cisco_csr_db.py
+++ b/neutron/services/vpn/service_drivers/cisco_csr_db.py
@@ -20,7 +20,7 @@ from neutron.common import exceptions
 from neutron.db import model_base
 from neutron.db import models_v2
 from neutron.db.vpn import vpn_db
-from neutron.openstack.common.gettextutils import _LI
+from neutron.i18n import _LI
 from neutron.openstack.common import log as logging
 
 LOG = logging.getLogger(__name__)
diff --git a/openstack-common.conf b/openstack-common.conf
index 56f22ee7d..7bba50dfa 100644
--- a/openstack-common.conf
+++ b/openstack-common.conf
@@ -5,7 +5,6 @@ module=context
 module=eventlet_backdoor
 module=fileutils
 module=fixture
-module=gettextutils
 module=install_venv_common
 module=local
 module=lockutils
diff --git a/requirements.txt b/requirements.txt
index 241a73c27..f0785a5d8 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -8,7 +8,6 @@ PasteDeploy>=1.5.0
 Routes>=1.12.3,!=2.0
 anyjson>=0.3.3
 argparse
-Babel>=1.3
 eventlet>=0.15.2
 greenlet>=0.3.2
 httplib2>=0.7.5
diff --git a/tox.ini b/tox.ini
index 7e16f19ca..1135abc87 100644
--- a/tox.ini
+++ b/tox.ini
@@ -88,5 +88,5 @@ commands =
   pylint --rcfile=.pylintrc --output-format=colorized {posargs:neutron}
 
 [hacking]
-import_exceptions = neutron.openstack.common.gettextutils
+import_exceptions = neutron.i18n
 local-check-factory = neutron.hacking.checks.factory