From: Jay S. Bryant Date: Wed, 21 Jan 2015 07:43:00 +0000 (-0600) Subject: Move oslo.serialization to oslo_serialization namespace X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=30bb83d64ffebeb7d0cdca170e658f25f3e02c63;p=openstack-build%2Fcinder-build.git Move oslo.serialization to oslo_serialization namespace This is the fifth in a series of changes to move to using the new oslo_ namespace that is being used for oslo libraries. There is currently a shim in place that is allowing the old oslo. imports to work, but we need to be prepared for when the shims go away. Thus, we need patches like this one to move to the new namespace. This patch also updates our hacking check to ensure that no instances of oslo.utils sneak back in. Change-Id: Ida0f9512a816d45ec5cae4dc4da4dbc923a67cf4 Partial-bug: 1409733 --- diff --git a/cinder/api/middleware/auth.py b/cinder/api/middleware/auth.py index 5d4546baf..7fee956b1 100644 --- a/cinder/api/middleware/auth.py +++ b/cinder/api/middleware/auth.py @@ -20,8 +20,8 @@ Common Auth Middleware. import os -from oslo.serialization import jsonutils from oslo_config import cfg +from oslo_serialization import jsonutils import webob.dec import webob.exc diff --git a/cinder/api/openstack/wsgi.py b/cinder/api/openstack/wsgi.py index 6b3a1ee2f..703f71243 100644 --- a/cinder/api/openstack/wsgi.py +++ b/cinder/api/openstack/wsgi.py @@ -21,7 +21,7 @@ from xml.dom import minidom from xml.parsers import expat from lxml import etree -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils from oslo_utils import excutils import six import webob diff --git a/cinder/api/v1/limits.py b/cinder/api/v1/limits.py index 7793b20ac..f521d9055 100644 --- a/cinder/api/v1/limits.py +++ b/cinder/api/v1/limits.py @@ -24,7 +24,7 @@ import math import re import time -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils from oslo_utils import importutils import webob.dec import webob.exc diff --git a/cinder/api/v2/limits.py b/cinder/api/v2/limits.py index 6df83b983..abad4b9e4 100644 --- a/cinder/api/v2/limits.py +++ b/cinder/api/v2/limits.py @@ -24,7 +24,7 @@ import math import re import time -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils from oslo_utils import importutils import webob.dec import webob.exc diff --git a/cinder/backup/driver.py b/cinder/backup/driver.py index bd4bcdac1..0f20a1275 100644 --- a/cinder/backup/driver.py +++ b/cinder/backup/driver.py @@ -17,8 +17,8 @@ import abc -from oslo.serialization import jsonutils from oslo_config import cfg +from oslo_serialization import jsonutils import six from cinder.db import base diff --git a/cinder/hacking/checks.py b/cinder/hacking/checks.py index b7965ec5b..231d65999 100644 --- a/cinder/hacking/checks.py +++ b/cinder/hacking/checks.py @@ -44,7 +44,7 @@ no_audit_log = re.compile(r"(.)*LOG\.audit(.)*") # NOTE(jsbryant): When other oslo libraries switch over non-namespaced # imports, we will need to add them to the regex below. oslo_namespace_imports = re.compile(r"from[\s]*oslo[.](concurrency|db" - "|config|utils)") + "|config|utils|serialization)") def no_vi_headers(physical_line, line_number, lines): diff --git a/cinder/image/glance.py b/cinder/image/glance.py index 1f85429f3..ef76aeb0a 100644 --- a/cinder/image/glance.py +++ b/cinder/image/glance.py @@ -27,8 +27,8 @@ import sys import time import glanceclient.exc -from oslo.serialization import jsonutils from oslo_config import cfg +from oslo_serialization import jsonutils from oslo_utils import timeutils import six.moves.urllib.parse as urlparse diff --git a/cinder/rpc.py b/cinder/rpc.py index 49491db3a..432741a32 100644 --- a/cinder/rpc.py +++ b/cinder/rpc.py @@ -27,8 +27,8 @@ __all__ = [ ] from oslo import messaging -from oslo.serialization import jsonutils from oslo_config import cfg +from oslo_serialization import jsonutils from osprofiler import profiler import cinder.context diff --git a/cinder/scheduler/rpcapi.py b/cinder/scheduler/rpcapi.py index 189333e81..2e5a1a177 100644 --- a/cinder/scheduler/rpcapi.py +++ b/cinder/scheduler/rpcapi.py @@ -17,8 +17,8 @@ Client side of the scheduler manager RPC API. """ from oslo import messaging -from oslo.serialization import jsonutils from oslo_config import cfg +from oslo_serialization import jsonutils from cinder import rpc diff --git a/cinder/tests/api/contrib/test_admin_actions.py b/cinder/tests/api/contrib/test_admin_actions.py index a037bcc4a..82cbb7231 100644 --- a/cinder/tests/api/contrib/test_admin_actions.py +++ b/cinder/tests/api/contrib/test_admin_actions.py @@ -13,10 +13,10 @@ import ast import fixtures -from oslo.serialization import jsonutils from oslo_concurrency import lockutils from oslo_config import cfg from oslo_config import fixture as config_fixture +from oslo_serialization import jsonutils from oslo_utils import timeutils import webob from webob import exc diff --git a/cinder/tests/api/contrib/test_extended_snapshot_attributes.py b/cinder/tests/api/contrib/test_extended_snapshot_attributes.py index 4007695ce..c1e6496ed 100644 --- a/cinder/tests/api/contrib/test_extended_snapshot_attributes.py +++ b/cinder/tests/api/contrib/test_extended_snapshot_attributes.py @@ -15,7 +15,7 @@ from lxml import etree -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils import webob from cinder.api.contrib import extended_snapshot_attributes diff --git a/cinder/tests/api/contrib/test_scheduler_hints.py b/cinder/tests/api/contrib/test_scheduler_hints.py index 42a611575..1098ee207 100644 --- a/cinder/tests/api/contrib/test_scheduler_hints.py +++ b/cinder/tests/api/contrib/test_scheduler_hints.py @@ -15,7 +15,7 @@ import datetime -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils import cinder from cinder.api.openstack import wsgi diff --git a/cinder/tests/api/contrib/test_snapshot_actions.py b/cinder/tests/api/contrib/test_snapshot_actions.py index b35d9af47..f955428ac 100644 --- a/cinder/tests/api/contrib/test_snapshot_actions.py +++ b/cinder/tests/api/contrib/test_snapshot_actions.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils import webob from cinder import db diff --git a/cinder/tests/api/contrib/test_volume_actions.py b/cinder/tests/api/contrib/test_volume_actions.py index 8b57043b5..15845f6fe 100644 --- a/cinder/tests/api/contrib/test_volume_actions.py +++ b/cinder/tests/api/contrib/test_volume_actions.py @@ -18,8 +18,8 @@ import uuid import mock from oslo import messaging -from oslo.serialization import jsonutils from oslo_config import cfg +from oslo_serialization import jsonutils import webob from cinder.api.contrib import volume_actions diff --git a/cinder/tests/api/contrib/test_volume_manage.py b/cinder/tests/api/contrib/test_volume_manage.py index 54e312c7f..9363e2647 100644 --- a/cinder/tests/api/contrib/test_volume_manage.py +++ b/cinder/tests/api/contrib/test_volume_manage.py @@ -13,7 +13,7 @@ # under the License. import mock -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils import webob from cinder import context diff --git a/cinder/tests/api/contrib/test_volume_unmanage.py b/cinder/tests/api/contrib/test_volume_unmanage.py index 88c1d8698..2939a61b8 100644 --- a/cinder/tests/api/contrib/test_volume_unmanage.py +++ b/cinder/tests/api/contrib/test_volume_unmanage.py @@ -13,7 +13,7 @@ # under the License. import mock -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils import webob from cinder import context diff --git a/cinder/tests/api/middleware/test_faults.py b/cinder/tests/api/middleware/test_faults.py index e8f2425c2..684f7c109 100644 --- a/cinder/tests/api/middleware/test_faults.py +++ b/cinder/tests/api/middleware/test_faults.py @@ -16,8 +16,8 @@ from xml.dom import minidom import mock -from oslo.serialization import jsonutils from oslo_i18n import fixture as i18n_fixture +from oslo_serialization import jsonutils import webob.dec from cinder.api import common diff --git a/cinder/tests/api/test_extensions.py b/cinder/tests/api/test_extensions.py index a7acdff45..374021ba0 100644 --- a/cinder/tests/api/test_extensions.py +++ b/cinder/tests/api/test_extensions.py @@ -16,8 +16,8 @@ import iso8601 from lxml import etree -from oslo.serialization import jsonutils from oslo_config import cfg +from oslo_serialization import jsonutils import webob from cinder.api import extensions diff --git a/cinder/tests/api/v1/test_limits.py b/cinder/tests/api/v1/test_limits.py index 4ab32200e..92db58521 100644 --- a/cinder/tests/api/v1/test_limits.py +++ b/cinder/tests/api/v1/test_limits.py @@ -21,7 +21,7 @@ import httplib from xml.dom import minidom from lxml import etree -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils import six import webob diff --git a/cinder/tests/api/v1/test_snapshot_metadata.py b/cinder/tests/api/v1/test_snapshot_metadata.py index c80ca3b83..89d1faf82 100644 --- a/cinder/tests/api/v1/test_snapshot_metadata.py +++ b/cinder/tests/api/v1/test_snapshot_metadata.py @@ -15,8 +15,8 @@ import uuid -from oslo.serialization import jsonutils from oslo_config import cfg +from oslo_serialization import jsonutils import webob from cinder.api import extensions diff --git a/cinder/tests/api/v1/test_volume_metadata.py b/cinder/tests/api/v1/test_volume_metadata.py index e0be0ca83..5cb270c40 100644 --- a/cinder/tests/api/v1/test_volume_metadata.py +++ b/cinder/tests/api/v1/test_volume_metadata.py @@ -15,8 +15,8 @@ import uuid -from oslo.serialization import jsonutils from oslo_config import cfg +from oslo_serialization import jsonutils import webob from cinder.api import extensions diff --git a/cinder/tests/api/v2/test_limits.py b/cinder/tests/api/v2/test_limits.py index 638b700cc..459bce894 100644 --- a/cinder/tests/api/v2/test_limits.py +++ b/cinder/tests/api/v2/test_limits.py @@ -21,7 +21,7 @@ import httplib from xml.dom import minidom from lxml import etree -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils import six import webob diff --git a/cinder/tests/api/v2/test_snapshot_metadata.py b/cinder/tests/api/v2/test_snapshot_metadata.py index e7e4a3aae..2fd62ca37 100644 --- a/cinder/tests/api/v2/test_snapshot_metadata.py +++ b/cinder/tests/api/v2/test_snapshot_metadata.py @@ -15,8 +15,8 @@ import uuid -from oslo.serialization import jsonutils from oslo_config import cfg +from oslo_serialization import jsonutils import webob from cinder.api import extensions diff --git a/cinder/tests/api/v2/test_volume_metadata.py b/cinder/tests/api/v2/test_volume_metadata.py index a3ed01551..ffc745df8 100644 --- a/cinder/tests/api/v2/test_volume_metadata.py +++ b/cinder/tests/api/v2/test_volume_metadata.py @@ -15,8 +15,8 @@ import uuid -from oslo.serialization import jsonutils from oslo_config import cfg +from oslo_serialization import jsonutils import webob from cinder.api import extensions diff --git a/cinder/tests/integrated/api/client.py b/cinder/tests/integrated/api/client.py index 95e419677..73acf9c10 100644 --- a/cinder/tests/integrated/api/client.py +++ b/cinder/tests/integrated/api/client.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils from oslo_utils import netutils import requests import six.moves.urllib.parse as urlparse diff --git a/cinder/tests/scheduler/test_host_filters.py b/cinder/tests/scheduler/test_host_filters.py index 172b87247..bb4d96692 100644 --- a/cinder/tests/scheduler/test_host_filters.py +++ b/cinder/tests/scheduler/test_host_filters.py @@ -16,7 +16,7 @@ Tests For Scheduler Host Filters. """ import mock -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils from requests import exceptions as request_exceptions from cinder.compute import nova diff --git a/cinder/tests/scheduler/test_scheduler_options.py b/cinder/tests/scheduler/test_scheduler_options.py index bd9bd052a..ec758840e 100644 --- a/cinder/tests/scheduler/test_scheduler_options.py +++ b/cinder/tests/scheduler/test_scheduler_options.py @@ -18,7 +18,7 @@ Tests For PickledScheduler. import datetime -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils import six from cinder.scheduler import scheduler_options diff --git a/cinder/tests/test_backup_ceph.py b/cinder/tests/test_backup_ceph.py index 4dd5815c6..2e6ea938a 100644 --- a/cinder/tests/test_backup_ceph.py +++ b/cinder/tests/test_backup_ceph.py @@ -21,8 +21,8 @@ import tempfile import uuid import mock -from oslo.serialization import jsonutils from oslo_concurrency import processutils +from oslo_serialization import jsonutils import six from cinder.backup import driver diff --git a/cinder/tests/test_backup_driver_base.py b/cinder/tests/test_backup_driver_base.py index fd91e0738..ce23c32a7 100644 --- a/cinder/tests/test_backup_driver_base.py +++ b/cinder/tests/test_backup_driver_base.py @@ -17,7 +17,7 @@ import uuid import mock -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils from cinder.backup import driver from cinder import context diff --git a/cinder/tests/test_coraid.py b/cinder/tests/test_coraid.py index a55a339f7..9bbc7ec41 100644 --- a/cinder/tests/test_coraid.py +++ b/cinder/tests/test_coraid.py @@ -18,8 +18,8 @@ import math import mock import mox -from oslo.serialization import jsonutils from oslo_config import cfg +from oslo_serialization import jsonutils from oslo_utils import units from cinder.brick.initiator import connector diff --git a/cinder/tests/test_hacking.py b/cinder/tests/test_hacking.py index 5dfb27b2f..3dbb22e76 100644 --- a/cinder/tests/test_hacking.py +++ b/cinder/tests/test_hacking.py @@ -155,3 +155,7 @@ class HackingTestCase(test.TestCase): "from oslo.utils import foo")))) self.assertEqual(0, len(list(checks.check_oslo_namespace_imports( "from oslo_utils import bar")))) + self.assertEqual(1, len(list(checks.check_oslo_namespace_imports( + "from oslo.serialization import foo")))) + self.assertEqual(0, len(list(checks.check_oslo_namespace_imports( + "from oslo_serialization import bar")))) diff --git a/cinder/tests/test_volume.py b/cinder/tests/test_volume.py index da0dfd427..f5ea37e51 100644 --- a/cinder/tests/test_volume.py +++ b/cinder/tests/test_volume.py @@ -29,8 +29,8 @@ import tempfile import eventlet import mock import mox -from oslo.serialization import jsonutils from oslo_config import cfg +from oslo_serialization import jsonutils from oslo_utils import importutils from oslo_utils import timeutils from oslo_utils import units diff --git a/cinder/tests/test_volume_rpcapi.py b/cinder/tests/test_volume_rpcapi.py index 33ba3c8ff..2fd17e51a 100644 --- a/cinder/tests/test_volume_rpcapi.py +++ b/cinder/tests/test_volume_rpcapi.py @@ -17,8 +17,8 @@ Unit Tests for cinder.volume.rpcapi """ import copy -from oslo.serialization import jsonutils from oslo_config import cfg +from oslo_serialization import jsonutils from cinder import context from cinder import db diff --git a/cinder/volume/drivers/coraid.py b/cinder/volume/drivers/coraid.py index e0c4bca8c..ea8c4fdf8 100644 --- a/cinder/volume/drivers/coraid.py +++ b/cinder/volume/drivers/coraid.py @@ -26,9 +26,9 @@ import math import urllib import urllib2 -from oslo.serialization import jsonutils from oslo_concurrency import lockutils from oslo_config import cfg +from oslo_serialization import jsonutils from oslo_utils import units import six.moves.urllib.parse as urlparse diff --git a/cinder/volume/drivers/emc/emc_vnx_cli.py b/cinder/volume/drivers/emc/emc_vnx_cli.py index 4d72a3fa8..5389b99f7 100644 --- a/cinder/volume/drivers/emc/emc_vnx_cli.py +++ b/cinder/volume/drivers/emc/emc_vnx_cli.py @@ -21,10 +21,10 @@ import random import re import time -from oslo.serialization import jsonutils as json from oslo_concurrency import lockutils from oslo_concurrency import processutils from oslo_config import cfg +from oslo_serialization import jsonutils as json from oslo_utils import excutils from oslo_utils import timeutils import six diff --git a/cinder/volume/drivers/nexenta/jsonrpc.py b/cinder/volume/drivers/nexenta/jsonrpc.py index fc1152b58..8da767662 100644 --- a/cinder/volume/drivers/nexenta/jsonrpc.py +++ b/cinder/volume/drivers/nexenta/jsonrpc.py @@ -23,7 +23,7 @@ import urllib2 -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils from cinder.i18n import _, _LE, _LI from cinder.openstack.common import log as logging diff --git a/cinder/volume/manager.py b/cinder/volume/manager.py index 186b783c4..4c3c31b93 100644 --- a/cinder/volume/manager.py +++ b/cinder/volume/manager.py @@ -40,8 +40,8 @@ intact. import time from oslo import messaging -from oslo.serialization import jsonutils from oslo_config import cfg +from oslo_serialization import jsonutils from oslo_utils import excutils from oslo_utils import importutils from oslo_utils import timeutils diff --git a/cinder/volume/rpcapi.py b/cinder/volume/rpcapi.py index 99fe88208..e82692992 100644 --- a/cinder/volume/rpcapi.py +++ b/cinder/volume/rpcapi.py @@ -17,8 +17,8 @@ Client side of the volume RPC API. """ from oslo import messaging -from oslo.serialization import jsonutils from oslo_config import cfg +from oslo_serialization import jsonutils from cinder import rpc from cinder.volume import utils