Change oslo.serialization to oslo_serialization

The oslo libraries are moving away from namespace packages.

A hacking check is added to enforce use of the new location.

bp drop-namespace-packages

Change-Id: I76dc9f733b222144f0274f8854877587c3501d1e
This commit is contained in:
Brant Knudson 2015-01-16 17:48:38 -06:00 committed by Steve Martinelli
parent aa613dfb0d
commit 2b8d378563
32 changed files with 44 additions and 32 deletions

View File

@ -15,7 +15,7 @@
import sys
from keystoneclient.common import cms
from oslo.serialization import jsonutils
from oslo_serialization import jsonutils
from oslo_utils import importutils
from oslo_utils import timeutils
import six

View File

@ -12,7 +12,7 @@
import functools
from oslo.serialization import jsonutils
from oslo_serialization import jsonutils
from pycadf import cadftaxonomy as taxonomy
from six.moves.urllib import parse

View File

@ -26,7 +26,7 @@ from oslo.db import exception as db_exception
from oslo.db import options as db_options
from oslo.db.sqlalchemy import models
from oslo.db.sqlalchemy import session as db_session
from oslo.serialization import jsonutils
from oslo_serialization import jsonutils
import six
import sqlalchemy as sql
from sqlalchemy.ext import declarative

View File

@ -28,7 +28,7 @@ column.
"""
from oslo.serialization import jsonutils
from oslo_serialization import jsonutils
from oslo_utils import strutils
import sqlalchemy as sql
from sqlalchemy.orm import Session

View File

@ -28,7 +28,7 @@ column.
"""
from oslo.serialization import jsonutils
from oslo_serialization import jsonutils
from oslo_utils import strutils
import sqlalchemy as sql
from sqlalchemy.orm import sessionmaker

View File

@ -20,7 +20,7 @@ import sys
import migrate
from migrate import exceptions
from oslo.db.sqlalchemy import migration
from oslo.serialization import jsonutils
from oslo_serialization import jsonutils
from oslo_utils import importutils
import six
import sqlalchemy

View File

@ -23,7 +23,7 @@ import hashlib
import os
import pwd
from oslo.serialization import jsonutils
from oslo_serialization import jsonutils
from oslo_utils import strutils
import passlib.hash
import six

View File

@ -21,7 +21,7 @@
import copy
from oslo import i18n
from oslo.serialization import jsonutils
from oslo_serialization import jsonutils
from oslo_utils import importutils
from oslo_utils import strutils
import routes.middleware

View File

@ -37,7 +37,7 @@ import sys
import uuid
from keystoneclient.contrib.ec2 import utils as ec2_utils
from oslo.serialization import jsonutils
from oslo_serialization import jsonutils
import six
from keystone.common import controller

View File

@ -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 keystone.common import sql
from keystone.contrib.federation import core

View File

@ -16,7 +16,7 @@ import datetime
import random
import uuid
from oslo.serialization import jsonutils
from oslo_serialization import jsonutils
from oslo_utils import timeutils
import six

View File

@ -14,7 +14,7 @@
"""Extensions supporting OAuth1."""
from oslo.serialization import jsonutils
from oslo_serialization import jsonutils
from oslo_utils import timeutils
from keystone.common import controller

View File

@ -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 keystone.common import extension

View File

@ -14,7 +14,7 @@
import hashlib
from oslo.serialization import jsonutils
from oslo_serialization import jsonutils
from keystone.common import controller
from keystone.common import dependency

View File

@ -399,8 +399,8 @@ class CheckForLoggingIssues(BaseASTChecker):
def check_oslo_namespace_imports(logical_line, blank_before, filename):
oslo_namespace_imports = re.compile(
r"(((from)|(import))\s+oslo\.utils)|"
"(from\s+oslo\s+import\s+utils)")
r"(((from)|(import))\s+oslo\.((serialization)|(utils)))|"
"(from\s+oslo\s+import\s+((serialization)|(utils)))")
if re.match(oslo_namespace_imports, logical_line):
msg = ("K333: '%s' must be used instead of '%s'.") % (

View File

@ -12,8 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo.serialization import jsonutils
from oslo_middleware import sizelimit
from oslo_serialization import jsonutils
import six
from keystone.common import authorization

View File

@ -188,12 +188,24 @@ class HackingCode(fixtures.Fixture):
from oslo import utils
from oslo.utils import encodeutils
from oslo_utils import encodeutils
import oslo.serialization
import oslo_serialization
import oslo.serialization.jsonutils
import oslo_serialization.jsonutils
from oslo import serialization
from oslo.serialization import jsonutils
from oslo_serialization import jsonutils
""",
'expected_errors': [
(1, 0, 'K333'),
(3, 0, 'K333'),
(5, 0, 'K333'),
(6, 0, 'K333'),
(9, 0, 'K333'),
(11, 0, 'K333'),
(13, 0, 'K333'),
(14, 0, 'K333'),
],
}

View File

@ -15,7 +15,7 @@
import io
from oslo.serialization import jsonutils
from oslo_serialization import jsonutils
import six
import webtest

View File

@ -14,7 +14,7 @@
import uuid
from oslo.serialization import jsonutils
from oslo_serialization import jsonutils
import six
from keystone.common import wsgi

View File

@ -18,7 +18,7 @@ import uuid
from keystoneclient import exceptions as client_exceptions
from keystoneclient.v2_0 import client as ks_client
import mock
from oslo.serialization import jsonutils
from oslo_serialization import jsonutils
from oslo_utils import timeutils
import webob

View File

@ -15,7 +15,7 @@
import datetime
import uuid
from oslo.serialization import jsonutils
from oslo_serialization import jsonutils
from oslo_utils import timeutils
import six
from testtools import matchers

View File

@ -17,7 +17,7 @@ import uuid
from lxml import etree
import mock
from oslo.serialization import jsonutils
from oslo_serialization import jsonutils
from oslotest import mockpatch
import saml2
from saml2 import saml

View File

@ -15,7 +15,7 @@
import uuid
from oslo.serialization import jsonutils
from oslo_serialization import jsonutils
from keystone import config
from keystone.policy.backends import rules

View File

@ -15,7 +15,7 @@
import copy
import uuid
from oslo.serialization import jsonutils
from oslo_serialization import jsonutils
from six.moves import urllib
from keystone import config

View File

@ -15,7 +15,7 @@
import uuid
from oslo.serialization import jsonutils
from oslo_serialization import jsonutils
from keystone import config
from keystone import exception

View File

@ -18,7 +18,7 @@ import functools
import random
import mock
from oslo.serialization import jsonutils
from oslo_serialization import jsonutils
from testtools import matchers as tt_matchers
from keystone.common import json_home

View File

@ -18,7 +18,7 @@ import uuid
import mock
from oslo import i18n
from oslo.serialization import jsonutils
from oslo_serialization import jsonutils
import six
from testtools import matchers
import webob

View File

@ -13,7 +13,7 @@
import datetime
import uuid
from oslo.serialization import jsonutils
from oslo_serialization import jsonutils
from keystone.common import utils as common_utils
from keystone import config

View File

@ -16,7 +16,7 @@ import datetime
import sys
from keystoneclient.common import cms
from oslo.serialization import jsonutils
from oslo_serialization import jsonutils
from oslo_utils import timeutils
import six

View File

@ -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 timeutils
import six
from six.moves.urllib import parse

View File

@ -15,7 +15,7 @@
"""Keystone PKI Token Provider"""
from keystoneclient.common import cms
from oslo.serialization import jsonutils
from oslo_serialization import jsonutils
from keystone.common import environment
from keystone.common import utils

View File

@ -13,7 +13,7 @@
"""Keystone Compressed PKI Token Provider"""
from keystoneclient.common import cms
from oslo.serialization import jsonutils
from oslo_serialization import jsonutils
from keystone.common import environment
from keystone.common import utils