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
This commit is contained in:
parent
d75623e01d
commit
30bb83d64f
|
@ -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…
Reference in New Issue