From 96ea2f1764e75be33e74809ae101280b0082c54e Mon Sep 17 00:00:00 2001 From: He Yongli Date: Wed, 12 Feb 2014 12:44:45 +0800 Subject: [PATCH] Use six.moves.urllib.parse instead of urlparse To keep Python 3.x compatibility, use six.moves.urllib.parse to replace urlparse. Closes-Bug: #1279611 Change-Id: I712035926f449e1bc5ab1fe85927369b826cb9cc --- neutron/agent/metadata/agent.py | 2 +- neutron/agent/metadata/namespace_proxy.py | 3 ++- neutron/api/v2/router.py | 3 +-- neutron/plugins/nicira/api_client/request.py | 2 +- neutron/tests/unit/nicira/fake_nvpapiclient.py | 3 ++- neutron/tests/unit/test_api_v2.py | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/neutron/agent/metadata/agent.py b/neutron/agent/metadata/agent.py index ce2751630..6209ebee8 100644 --- a/neutron/agent/metadata/agent.py +++ b/neutron/agent/metadata/agent.py @@ -20,12 +20,12 @@ import hashlib import hmac import os import socket -import urlparse import eventlet import httplib2 from neutronclient.v2_0 import client from oslo.config import cfg +import six.moves.urllib.parse as urlparse import webob from neutron.agent.common import config as agent_conf diff --git a/neutron/agent/metadata/namespace_proxy.py b/neutron/agent/metadata/namespace_proxy.py index 9b8bcdddb..c6addb8fe 100644 --- a/neutron/agent/metadata/namespace_proxy.py +++ b/neutron/agent/metadata/namespace_proxy.py @@ -18,11 +18,12 @@ import httplib import socket -import urlparse + import eventlet import httplib2 from oslo.config import cfg +import six.moves.urllib.parse as urlparse import webob from neutron.agent.linux import daemon diff --git a/neutron/api/v2/router.py b/neutron/api/v2/router.py index 1a4196c50..f1b5787d9 100644 --- a/neutron/api/v2/router.py +++ b/neutron/api/v2/router.py @@ -13,10 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import urlparse - from oslo.config import cfg import routes as routes_mapper +import six.moves.urllib.parse as urlparse import webob import webob.dec import webob.exc diff --git a/neutron/plugins/nicira/api_client/request.py b/neutron/plugins/nicira/api_client/request.py index 4cc00f868..c62ef8e78 100644 --- a/neutron/plugins/nicira/api_client/request.py +++ b/neutron/plugins/nicira/api_client/request.py @@ -24,9 +24,9 @@ import copy import httplib import logging import time -import urlparse import six +import six.moves.urllib.parse as urlparse from neutron.openstack.common import excutils from neutron.plugins.nicira.api_client.common import ( diff --git a/neutron/tests/unit/nicira/fake_nvpapiclient.py b/neutron/tests/unit/nicira/fake_nvpapiclient.py index 577be6c51..a367b246b 100644 --- a/neutron/tests/unit/nicira/fake_nvpapiclient.py +++ b/neutron/tests/unit/nicira/fake_nvpapiclient.py @@ -15,7 +15,8 @@ # under the License. import json -import urlparse + +import six.moves.urllib.parse as urlparse from neutron.openstack.common import log as logging from neutron.openstack.common import uuidutils diff --git a/neutron/tests/unit/test_api_v2.py b/neutron/tests/unit/test_api_v2.py index 61e3eb371..1539c52b7 100644 --- a/neutron/tests/unit/test_api_v2.py +++ b/neutron/tests/unit/test_api_v2.py @@ -16,10 +16,10 @@ # under the License. import os -import urlparse import mock from oslo.config import cfg +import six.moves.urllib.parse as urlparse import webob from webob import exc import webtest -- 2.45.2