Move oslo.serialization to oslo_serialization namespace

This is the fifth in a series of changes to move to using
the new oslo_<library> namespace that is being used for
oslo libraries.

There is currently a shim in place that is allowing the old
oslo.<library> 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
changes/26/149426/1
Jay S. Bryant 8 years ago
parent d75623e01d
commit 30bb83d64f
  1. 2
      cinder/api/middleware/auth.py
  2. 2
      cinder/api/openstack/wsgi.py
  3. 2
      cinder/api/v1/limits.py
  4. 2
      cinder/api/v2/limits.py
  5. 2
      cinder/backup/driver.py
  6. 2
      cinder/hacking/checks.py
  7. 2
      cinder/image/glance.py
  8. 2
      cinder/rpc.py
  9. 2
      cinder/scheduler/rpcapi.py
  10. 2
      cinder/tests/api/contrib/test_admin_actions.py
  11. 2
      cinder/tests/api/contrib/test_extended_snapshot_attributes.py
  12. 2
      cinder/tests/api/contrib/test_scheduler_hints.py
  13. 2
      cinder/tests/api/contrib/test_snapshot_actions.py
  14. 2
      cinder/tests/api/contrib/test_volume_actions.py
  15. 2
      cinder/tests/api/contrib/test_volume_manage.py
  16. 2
      cinder/tests/api/contrib/test_volume_unmanage.py
  17. 2
      cinder/tests/api/middleware/test_faults.py
  18. 2
      cinder/tests/api/test_extensions.py
  19. 2
      cinder/tests/api/v1/test_limits.py
  20. 2
      cinder/tests/api/v1/test_snapshot_metadata.py
  21. 2
      cinder/tests/api/v1/test_volume_metadata.py
  22. 2
      cinder/tests/api/v2/test_limits.py
  23. 2
      cinder/tests/api/v2/test_snapshot_metadata.py
  24. 2
      cinder/tests/api/v2/test_volume_metadata.py
  25. 2
      cinder/tests/integrated/api/client.py
  26. 2
      cinder/tests/scheduler/test_host_filters.py
  27. 2
      cinder/tests/scheduler/test_scheduler_options.py
  28. 2
      cinder/tests/test_backup_ceph.py
  29. 2
      cinder/tests/test_backup_driver_base.py
  30. 2
      cinder/tests/test_coraid.py
  31. 4
      cinder/tests/test_hacking.py
  32. 2
      cinder/tests/test_volume.py
  33. 2
      cinder/tests/test_volume_rpcapi.py
  34. 2
      cinder/volume/drivers/coraid.py
  35. 2
      cinder/volume/drivers/emc/emc_vnx_cli.py
  36. 2
      cinder/volume/drivers/nexenta/jsonrpc.py
  37. 2
      cinder/volume/manager.py
  38. 2
      cinder/volume/rpcapi.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

@ -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

@ -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

@ -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

@ -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

@ -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):

@ -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

@ -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

@ -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

@ -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

@ -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

@ -15,7 +15,7 @@
import datetime
from oslo.serialization import jsonutils
from oslo_serialization import jsonutils
import cinder
from cinder.api.openstack import wsgi

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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"))))

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

Loading…
Cancel
Save