Merge "switch to oslo.serialization"

This commit is contained in:
Jenkins 2014-11-15 00:41:56 +00:00 committed by Gerrit Code Review
commit 8806ed2494
55 changed files with 73 additions and 242 deletions

View File

@ -23,6 +23,7 @@ import sys
import netaddr import netaddr
from oslo.config import cfg from oslo.config import cfg
from oslo.serialization import jsonutils
import six import six
from neutron.agent.linux import ip_lib from neutron.agent.linux import ip_lib
@ -31,7 +32,6 @@ from neutron.common import constants
from neutron.common import exceptions from neutron.common import exceptions
from neutron.common import utils as commonutils from neutron.common import utils as commonutils
from neutron.openstack.common import importutils from neutron.openstack.common import importutils
from neutron.openstack.common import jsonutils
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging
from neutron.openstack.common import uuidutils from neutron.openstack.common import uuidutils

View File

@ -17,13 +17,13 @@ import itertools
import operator import operator
from oslo.config import cfg from oslo.config import cfg
from oslo.serialization import jsonutils
from neutron.agent.linux import ip_lib from neutron.agent.linux import ip_lib
from neutron.agent.linux import utils from neutron.agent.linux import utils
from neutron.common import exceptions from neutron.common import exceptions
from neutron.openstack.common import excutils from neutron.openstack.common import excutils
from neutron.openstack.common.gettextutils import _LI, _LW from neutron.openstack.common.gettextutils import _LI, _LW
from neutron.openstack.common import jsonutils
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging
from neutron.plugins.common import constants from neutron.plugins.common import constants

View File

@ -14,6 +14,7 @@
# limitations under the License. # limitations under the License.
from oslo.config import cfg from oslo.config import cfg
from oslo.serialization import jsonutils
from neutron.common import constants from neutron.common import constants
from neutron.common import exceptions from neutron.common import exceptions
@ -23,7 +24,6 @@ from neutron import context as neutron_context
from neutron.extensions import l3 from neutron.extensions import l3
from neutron.extensions import portbindings from neutron.extensions import portbindings
from neutron import manager from neutron import manager
from neutron.openstack.common import jsonutils
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging
from neutron.plugins.common import constants as plugin_constants from neutron.plugins.common import constants as plugin_constants

View File

@ -17,6 +17,7 @@ from eventlet import greenthread
from oslo.config import cfg from oslo.config import cfg
from oslo.db import exception as db_exc from oslo.db import exception as db_exc
from oslo.serialization import jsonutils
import sqlalchemy as sa import sqlalchemy as sa
from sqlalchemy.orm import exc from sqlalchemy.orm import exc
from sqlalchemy import sql from sqlalchemy import sql
@ -27,7 +28,6 @@ from neutron.db import models_v2
from neutron.extensions import agent as ext_agent from neutron.extensions import agent as ext_agent
from neutron import manager from neutron import manager
from neutron.openstack.common import excutils from neutron.openstack.common import excutils
from neutron.openstack.common import jsonutils
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging
from neutron.openstack.common import timeutils from neutron.openstack.common import timeutils

View File

@ -1,186 +0,0 @@
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
'''
JSON related utilities.
This module provides a few things:
1) A handy function for getting an object down to something that can be
JSON serialized. See to_primitive().
2) Wrappers around loads() and dumps(). The dumps() wrapper will
automatically use to_primitive() for you if needed.
3) This sets up anyjson to use the loads() and dumps() wrappers if anyjson
is available.
'''
import codecs
import datetime
import functools
import inspect
import itertools
import sys
if sys.version_info < (2, 7):
# On Python <= 2.6, json module is not C boosted, so try to use
# simplejson module if available
try:
import simplejson as json
except ImportError:
import json
else:
import json
import six
import six.moves.xmlrpc_client as xmlrpclib
from neutron.openstack.common import gettextutils
from neutron.openstack.common import importutils
from neutron.openstack.common import strutils
from neutron.openstack.common import timeutils
netaddr = importutils.try_import("netaddr")
_nasty_type_tests = [inspect.ismodule, inspect.isclass, inspect.ismethod,
inspect.isfunction, inspect.isgeneratorfunction,
inspect.isgenerator, inspect.istraceback, inspect.isframe,
inspect.iscode, inspect.isbuiltin, inspect.isroutine,
inspect.isabstract]
_simple_types = (six.string_types + six.integer_types
+ (type(None), bool, float))
def to_primitive(value, convert_instances=False, convert_datetime=True,
level=0, max_depth=3):
"""Convert a complex object into primitives.
Handy for JSON serialization. We can optionally handle instances,
but since this is a recursive function, we could have cyclical
data structures.
To handle cyclical data structures we could track the actual objects
visited in a set, but not all objects are hashable. Instead we just
track the depth of the object inspections and don't go too deep.
Therefore, convert_instances=True is lossy ... be aware.
"""
# handle obvious types first - order of basic types determined by running
# full tests on nova project, resulting in the following counts:
# 572754 <type 'NoneType'>
# 460353 <type 'int'>
# 379632 <type 'unicode'>
# 274610 <type 'str'>
# 199918 <type 'dict'>
# 114200 <type 'datetime.datetime'>
# 51817 <type 'bool'>
# 26164 <type 'list'>
# 6491 <type 'float'>
# 283 <type 'tuple'>
# 19 <type 'long'>
if isinstance(value, _simple_types):
return value
if isinstance(value, datetime.datetime):
if convert_datetime:
return timeutils.strtime(value)
else:
return value
# value of itertools.count doesn't get caught by nasty_type_tests
# and results in infinite loop when list(value) is called.
if type(value) == itertools.count:
return six.text_type(value)
# FIXME(vish): Workaround for LP bug 852095. Without this workaround,
# tests that raise an exception in a mocked method that
# has a @wrap_exception with a notifier will fail. If
# we up the dependency to 0.5.4 (when it is released) we
# can remove this workaround.
if getattr(value, '__module__', None) == 'mox':
return 'mock'
if level > max_depth:
return '?'
# The try block may not be necessary after the class check above,
# but just in case ...
try:
recursive = functools.partial(to_primitive,
convert_instances=convert_instances,
convert_datetime=convert_datetime,
level=level,
max_depth=max_depth)
if isinstance(value, dict):
return dict((k, recursive(v)) for k, v in six.iteritems(value))
elif isinstance(value, (list, tuple)):
return [recursive(lv) for lv in value]
# It's not clear why xmlrpclib created their own DateTime type, but
# for our purposes, make it a datetime type which is explicitly
# handled
if isinstance(value, xmlrpclib.DateTime):
value = datetime.datetime(*tuple(value.timetuple())[:6])
if convert_datetime and isinstance(value, datetime.datetime):
return timeutils.strtime(value)
elif isinstance(value, gettextutils.Message):
return value.data
elif hasattr(value, 'iteritems'):
return recursive(dict(value.iteritems()), level=level + 1)
elif hasattr(value, '__iter__'):
return recursive(list(value))
elif convert_instances and hasattr(value, '__dict__'):
# Likely an instance of something. Watch for cycles.
# Ignore class member vars.
return recursive(value.__dict__, level=level + 1)
elif netaddr and isinstance(value, netaddr.IPAddress):
return six.text_type(value)
else:
if any(test(value) for test in _nasty_type_tests):
return six.text_type(value)
return value
except TypeError:
# Class objects are tricky since they may define something like
# __iter__ defined but it isn't callable as list().
return six.text_type(value)
def dumps(value, default=to_primitive, **kwargs):
return json.dumps(value, default=default, **kwargs)
def loads(s, encoding='utf-8', **kwargs):
return json.loads(strutils.safe_decode(s, encoding), **kwargs)
def load(fp, encoding='utf-8', **kwargs):
return json.load(codecs.getreader(encoding)(fp), **kwargs)
try:
import anyjson
except ImportError:
pass
else:
anyjson._modules.append((__name__, 'dumps', TypeError,
'loads', ValueError, 'load'))
anyjson.force_implementation(__name__)

View File

@ -37,11 +37,11 @@ import weakref
import eventlet import eventlet
import eventlet.corolocal import eventlet.corolocal
from oslo.config import cfg from oslo.config import cfg
from oslo.serialization import jsonutils
from neutron.common import exceptions from neutron.common import exceptions
from neutron.common import utils from neutron.common import utils
from neutron.openstack.common import excutils from neutron.openstack.common import excutils
from neutron.openstack.common import jsonutils
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging
from neutron.plugins.bigswitch.db import consistency_db as cdb from neutron.plugins.bigswitch.db import consistency_db as cdb

View File

@ -22,11 +22,10 @@ from __future__ import print_function
import re import re
from oslo.serialization import jsonutils
from six import moves from six import moves
from wsgiref import simple_server from wsgiref import simple_server
from neutron.openstack.common import jsonutils
class TestNetworkCtrl(object): class TestNetworkCtrl(object):

View File

@ -14,7 +14,8 @@
import logging import logging
from neutron.openstack.common import jsonutils from oslo.serialization import jsonutils
from neutron.plugins.cisco.cfg_agent.device_drivers import devicedriver_api from neutron.plugins.cisco.cfg_agent.device_drivers import devicedriver_api
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -12,11 +12,12 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from oslo.serialization import jsonutils
from neutron.common import constants from neutron.common import constants
from neutron.common import utils from neutron.common import utils
from neutron import context as neutron_context from neutron import context as neutron_context
from neutron.extensions import portbindings from neutron.extensions import portbindings
from neutron.openstack.common import jsonutils
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -13,13 +13,14 @@
# under the License. # under the License.
import base64 import base64
import eventlet import eventlet
import netaddr import netaddr
from oslo.serialization import jsonutils
import requests import requests
from neutron.common import exceptions as n_exc from neutron.common import exceptions as n_exc
from neutron.extensions import providernet from neutron.extensions import providernet
from neutron.openstack.common import jsonutils
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging
from neutron.plugins.cisco.common import cisco_constants as c_const from neutron.plugins.cisco.common import cisco_constants as c_const
from neutron.plugins.cisco.common import cisco_credentials_v2 as c_cred from neutron.plugins.cisco.common import cisco_credentials_v2 as c_cred

View File

@ -13,9 +13,10 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from oslo.serialization import jsonutils
from neutron.common import constants from neutron.common import constants
from neutron.extensions import portbindings from neutron.extensions import portbindings
from neutron.openstack.common import jsonutils
from neutron.plugins.ml2 import db from neutron.plugins.ml2 import db
from neutron.plugins.ml2 import driver_api as api from neutron.plugins.ml2 import driver_api as api

View File

@ -13,13 +13,13 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from oslo.serialization import jsonutils
from sqlalchemy import sql from sqlalchemy import sql
from neutron.common import constants as const from neutron.common import constants as const
from neutron.db import agents_db from neutron.db import agents_db
from neutron.db import common_db_mixin as base_db from neutron.db import common_db_mixin as base_db
from neutron.db import models_v2 from neutron.db import models_v2
from neutron.openstack.common import jsonutils
from neutron.openstack.common import timeutils from neutron.openstack.common import timeutils
from neutron.plugins.ml2.drivers.l2pop import constants as l2_const from neutron.plugins.ml2.drivers.l2pop import constants as l2_const
from neutron.plugins.ml2 import models as ml2_models from neutron.plugins.ml2 import models as ml2_models

View File

@ -16,9 +16,9 @@
import re import re
from oslo.config import cfg from oslo.config import cfg
from oslo.serialization import jsonutils
import requests import requests
from neutron.openstack.common import jsonutils
from neutron.openstack.common import log from neutron.openstack.common import log
from neutron.plugins.ml2 import driver_api as api from neutron.plugins.ml2 import driver_api as api

View File

@ -16,6 +16,7 @@
import time import time
from oslo.config import cfg from oslo.config import cfg
from oslo.serialization import jsonutils
import requests import requests
from neutron.common import constants as n_const from neutron.common import constants as n_const
@ -23,7 +24,6 @@ from neutron.common import exceptions as n_exc
from neutron.common import utils from neutron.common import utils
from neutron.extensions import portbindings from neutron.extensions import portbindings
from neutron.openstack.common import excutils from neutron.openstack.common import excutils
from neutron.openstack.common import jsonutils
from neutron.openstack.common import log from neutron.openstack.common import log
from neutron.plugins.common import constants from neutron.plugins.common import constants
from neutron.plugins.ml2 import driver_api as api from neutron.plugins.ml2 import driver_api as api

View File

@ -18,6 +18,7 @@ from eventlet import greenthread
from oslo.config import cfg from oslo.config import cfg
from oslo.db import exception as os_db_exception from oslo.db import exception as os_db_exception
from oslo.serialization import jsonutils
from sqlalchemy import exc as sql_exc from sqlalchemy import exc as sql_exc
from sqlalchemy.orm import exc as sa_exc from sqlalchemy.orm import exc as sa_exc
@ -53,7 +54,6 @@ from neutron import manager
from neutron.openstack.common import excutils from neutron.openstack.common import excutils
from neutron.openstack.common.gettextutils import _LI from neutron.openstack.common.gettextutils import _LI
from neutron.openstack.common import importutils from neutron.openstack.common import importutils
from neutron.openstack.common import jsonutils
from neutron.openstack.common import lockutils from neutron.openstack.common import lockutils
from neutron.openstack.common import log from neutron.openstack.common import log
from neutron.openstack.common import uuidutils from neutron.openstack.common import uuidutils

View File

@ -13,8 +13,9 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from oslo.serialization import jsonutils
from neutron.openstack.common import importutils from neutron.openstack.common import importutils
from neutron.openstack.common import jsonutils
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging
from neutron.plugins.mlnx.common import comm_utils from neutron.plugins.mlnx.common import comm_utils
from neutron.plugins.mlnx.common import exceptions from neutron.plugins.mlnx.common import exceptions

View File

@ -14,10 +14,10 @@
import time import time
from oslo.serialization import jsonutils
import requests import requests
from neutron.openstack.common import excutils from neutron.openstack.common import excutils
from neutron.openstack.common import jsonutils
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging
from neutron.plugins.nec.common import config from neutron.plugins.nec.common import config
from neutron.plugins.nec.common import exceptions as nexc from neutron.plugins.nec.common import exceptions as nexc

View File

@ -14,8 +14,9 @@
"""Intermidiate NVSD Library.""" """Intermidiate NVSD Library."""
from oslo.serialization import jsonutils
from neutron.openstack.common import excutils from neutron.openstack.common import excutils
from neutron.openstack.common import jsonutils
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging
import neutron.plugins.oneconvergence.lib.exception as nvsdexception import neutron.plugins.oneconvergence.lib.exception as nvsdexception
from neutron.plugins.oneconvergence.lib import plugin_helper from neutron.plugins.oneconvergence.lib import plugin_helper

View File

@ -18,10 +18,10 @@ import httplib
import time import time
from oslo.config import cfg from oslo.config import cfg
from oslo.serialization import jsonutils
import requests import requests
from six.moves.urllib import parse from six.moves.urllib import parse
from neutron.openstack.common import jsonutils
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging
import neutron.plugins.oneconvergence.lib.exception as exception import neutron.plugins.oneconvergence.lib.exception as exception

View File

@ -14,6 +14,7 @@
# #
from oslo.config import cfg from oslo.config import cfg
from oslo.serialization import jsonutils
import requests import requests
from neutron.api.v2 import attributes as attr from neutron.api.v2 import attributes as attr
@ -23,7 +24,6 @@ from neutron.extensions import external_net
from neutron.extensions import portbindings from neutron.extensions import portbindings
from neutron.extensions import securitygroup from neutron.extensions import securitygroup
from neutron import neutron_plugin_base_v2 from neutron import neutron_plugin_base_v2
from neutron.openstack.common import jsonutils
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging
from neutron.plugins.opencontrail.common import exceptions as c_exc from neutron.plugins.opencontrail.common import exceptions as c_exc

View File

@ -14,11 +14,12 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import eventlet
import httplib import httplib
import urllib import urllib
from neutron.openstack.common import jsonutils import eventlet
from oslo.serialization import jsonutils
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging
from neutron.plugins.vmware.api_client import request from neutron.plugins.vmware.api_client import request

View File

@ -15,6 +15,8 @@
import random import random
from oslo.serialization import jsonutils
from neutron.common import constants from neutron.common import constants
from neutron.common import exceptions from neutron.common import exceptions
from neutron import context from neutron import context
@ -22,7 +24,6 @@ from neutron.db import external_net_db
from neutron.db import l3_db from neutron.db import l3_db
from neutron.db import models_v2 from neutron.db import models_v2
from neutron.extensions import l3 from neutron.extensions import l3
from neutron.openstack.common import jsonutils
from neutron.openstack.common import log from neutron.openstack.common import log
from neutron.openstack.common import loopingcall from neutron.openstack.common import loopingcall
from neutron.openstack.common import timeutils from neutron.openstack.common import timeutils

View File

@ -13,8 +13,9 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from oslo.serialization import jsonutils
from neutron.common import exceptions as exception from neutron.common import exceptions as exception
from neutron.openstack.common import jsonutils
from neutron.openstack.common import log from neutron.openstack.common import log
from neutron.plugins.vmware.api_client import exception as api_exc from neutron.plugins.vmware.api_client import exception as api_exc
from neutron.plugins.vmware.common import exceptions as nsx_exc from neutron.plugins.vmware.common import exceptions as nsx_exc

View File

@ -14,7 +14,8 @@
# under the License. # under the License.
# #
from neutron.openstack.common import jsonutils from oslo.serialization import jsonutils
from neutron.openstack.common import log from neutron.openstack.common import log
from neutron.plugins.vmware.api_client import exception as api_exc from neutron.plugins.vmware.api_client import exception as api_exc
from neutron.plugins.vmware.common import exceptions as nsx_exc from neutron.plugins.vmware.common import exceptions as nsx_exc

View File

@ -13,8 +13,9 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from oslo.serialization import jsonutils
from neutron.common import exceptions as exception from neutron.common import exceptions as exception
from neutron.openstack.common import jsonutils
from neutron.openstack.common import log from neutron.openstack.common import log
from neutron.plugins.vmware.api_client import exception as api_exc from neutron.plugins.vmware.api_client import exception as api_exc
from neutron.plugins.vmware.common import exceptions as nsx_exc from neutron.plugins.vmware.common import exceptions as nsx_exc

View File

@ -13,10 +13,11 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from oslo.serialization import jsonutils
from neutron.api.v2 import attributes as attr from neutron.api.v2 import attributes as attr
from neutron.common import exceptions as exception from neutron.common import exceptions as exception
from neutron.openstack.common import excutils from neutron.openstack.common import excutils
from neutron.openstack.common import jsonutils
from neutron.openstack.common import log from neutron.openstack.common import log
from neutron.plugins.vmware.api_client import exception as api_exc from neutron.plugins.vmware.api_client import exception as api_exc
from neutron.plugins.vmware.common import utils from neutron.plugins.vmware.common import utils

View File

@ -14,10 +14,10 @@
# under the License. # under the License.
from oslo.config import cfg from oslo.config import cfg
from oslo.serialization import jsonutils
from neutron.common import exceptions as exception from neutron.common import exceptions as exception
from neutron.openstack.common import excutils from neutron.openstack.common import excutils
from neutron.openstack.common import jsonutils
from neutron.openstack.common import log from neutron.openstack.common import log
from neutron.plugins.vmware.api_client import exception as api_exc from neutron.plugins.vmware.api_client import exception as api_exc
from neutron.plugins.vmware.common import exceptions as nsx_exc from neutron.plugins.vmware.common import exceptions as nsx_exc

View File

@ -13,10 +13,11 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from oslo.serialization import jsonutils
from neutron.common import constants from neutron.common import constants
from neutron.common import exceptions from neutron.common import exceptions
from neutron.openstack.common import excutils from neutron.openstack.common import excutils
from neutron.openstack.common import jsonutils
from neutron.openstack.common import log from neutron.openstack.common import log
from neutron.plugins.vmware.common import utils from neutron.plugins.vmware.common import utils
from neutron.plugins.vmware import nsxlib from neutron.plugins.vmware import nsxlib

View File

@ -15,10 +15,10 @@
# #
from oslo.config import cfg from oslo.config import cfg
from oslo.serialization import jsonutils
from neutron.common import constants from neutron.common import constants
from neutron.common import exceptions as exception from neutron.common import exceptions as exception
from neutron.openstack.common import jsonutils
from neutron.openstack.common import log from neutron.openstack.common import log
from neutron.plugins.vmware.api_client import exception as api_exc from neutron.plugins.vmware.api_client import exception as api_exc
from neutron.plugins.vmware.common import exceptions as nsx_exc from neutron.plugins.vmware.common import exceptions as nsx_exc

View File

@ -15,8 +15,8 @@
import base64 import base64
import eventlet import eventlet
from oslo.serialization import jsonutils
from neutron.openstack.common import jsonutils
from neutron.plugins.vmware.vshield.common import exceptions from neutron.plugins.vmware.vshield.common import exceptions
httplib2 = eventlet.import_patched('httplib2') httplib2 = eventlet.import_patched('httplib2')

View File

@ -12,8 +12,9 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from oslo.serialization import jsonutils
from neutron.openstack.common import excutils from neutron.openstack.common import excutils
from neutron.openstack.common import jsonutils
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging
from neutron.plugins.vmware.common import utils from neutron.plugins.vmware.common import utils
from neutron.plugins.vmware.vshield.common import constants as vcns_const from neutron.plugins.vmware.vshield.common import constants as vcns_const

View File

@ -12,7 +12,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from neutron.openstack.common import jsonutils from oslo.serialization import jsonutils
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging
from neutron.plugins.vmware.vshield.common import VcnsApiClient from neutron.plugins.vmware.vshield.common import VcnsApiClient

View File

@ -17,8 +17,8 @@ import base64
import httplib2 import httplib2
from oslo.config import cfg from oslo.config import cfg
from oslo.serialization import jsonutils
from neutron.openstack.common import jsonutils
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging
from neutron.services.firewall.agents.varmour import varmour_utils as va_utils from neutron.services.firewall.agents.varmour import varmour_utils as va_utils

View File

@ -13,10 +13,11 @@
# under the License. # under the License.
import base64 import base64
from oslo.serialization import jsonutils
import requests import requests
from neutron.common import exceptions as n_exc from neutron.common import exceptions as n_exc
from neutron.openstack.common import jsonutils
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -24,6 +24,7 @@ import eventlet
eventlet.monkey_patch(thread=True) eventlet.monkey_patch(thread=True)
from oslo.config import cfg from oslo.config import cfg
from oslo.serialization import jsonutils
from six.moves import queue as Queue from six.moves import queue as Queue
from neutron.api.v2 import attributes from neutron.api.v2 import attributes
@ -32,7 +33,6 @@ from neutron import context
from neutron.db.loadbalancer import loadbalancer_db as lb_db from neutron.db.loadbalancer import loadbalancer_db as lb_db
from neutron.extensions import loadbalancer from neutron.extensions import loadbalancer
from neutron.openstack.common import excutils from neutron.openstack.common import excutils
from neutron.openstack.common import jsonutils
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging
from neutron.plugins.common import constants from neutron.plugins.common import constants
from neutron.services.loadbalancer.drivers import abstract_driver from neutron.services.loadbalancer.drivers import abstract_driver

View File

@ -15,10 +15,10 @@
import time import time
import netaddr import netaddr
from oslo.serialization import jsonutils
import requests import requests
from requests import exceptions as r_exc from requests import exceptions as r_exc
from neutron.openstack.common import jsonutils
from neutron.openstack.common.gettextutils import _LE, _LW from neutron.openstack.common.gettextutils import _LE, _LW
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging

View File

@ -15,12 +15,12 @@
import collections import collections
import mock import mock
from oslo.config import cfg from oslo.config import cfg
from oslo.serialization import jsonutils
import testtools import testtools
from neutron.agent.linux import ovs_lib from neutron.agent.linux import ovs_lib
from neutron.agent.linux import utils from neutron.agent.linux import utils
from neutron.common import exceptions from neutron.common import exceptions
from neutron.openstack.common import jsonutils
from neutron.openstack.common import uuidutils from neutron.openstack.common import uuidutils
from neutron.plugins.common import constants from neutron.plugins.common import constants
from neutron.tests import base from neutron.tests import base

View File

@ -12,7 +12,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from neutron.openstack.common import jsonutils from oslo.serialization import jsonutils
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging
from neutron.plugins.bigswitch import servermanager from neutron.plugins.bigswitch import servermanager

View File

@ -18,11 +18,11 @@ import ssl
import mock import mock
from oslo.config import cfg from oslo.config import cfg
from oslo.serialization import jsonutils
from neutron import context from neutron import context
from neutron import manager from neutron import manager
from neutron.openstack.common import importutils from neutron.openstack.common import importutils
from neutron.openstack.common import jsonutils
from neutron.plugins.bigswitch import servermanager from neutron.plugins.bigswitch import servermanager
from neutron.tests.unit.bigswitch import test_restproxy_plugin as test_rp from neutron.tests.unit.bigswitch import test_restproxy_plugin as test_rp

View File

@ -15,8 +15,9 @@
import abc import abc
from oslo.serialization import jsonutils
from neutron.api import extensions from neutron.api import extensions
from neutron.openstack.common import jsonutils
from neutron import wsgi from neutron import wsgi

View File

@ -18,11 +18,11 @@ import contextlib
import functools import functools
import mock import mock
from oslo.serialization import jsonutils
from neutron import context as neutron_context from neutron import context as neutron_context
from neutron.extensions import portbindings from neutron.extensions import portbindings
from neutron import manager from neutron import manager
from neutron.openstack.common import jsonutils
from neutron.plugins.bigswitch import servermanager from neutron.plugins.bigswitch import servermanager
from neutron.plugins.ml2 import config as ml2_config from neutron.plugins.ml2 import config as ml2_config
from neutron.plugins.ml2.drivers.mech_bigswitch import driver as bsn_driver from neutron.plugins.ml2.drivers.mech_bigswitch import driver as bsn_driver

View File

@ -14,9 +14,9 @@
# under the License. # under the License.
import mock import mock
from oslo.serialization import jsonutils
import requests import requests
from neutron.openstack.common import jsonutils
from neutron.plugins.common import constants from neutron.plugins.common import constants
from neutron.plugins.ml2 import config as config from neutron.plugins.ml2 import config as config
from neutron.plugins.ml2 import driver_api as api from neutron.plugins.ml2 import driver_api as api

View File

@ -14,9 +14,9 @@
import mock import mock
from oslo.config import cfg from oslo.config import cfg
from oslo.serialization import jsonutils
import requests import requests
from neutron.openstack.common import jsonutils
from neutron.plugins.nec.common import config from neutron.plugins.nec.common import config
from neutron.plugins.nec.common import exceptions as nexc from neutron.plugins.nec.common import exceptions as nexc
from neutron.plugins.nec.common import ofc_client from neutron.plugins.nec.common import ofc_client

View File

@ -14,8 +14,8 @@
# #
import mock import mock
from oslo.serialization import jsonutils
from neutron.openstack.common import jsonutils
from neutron.plugins.oneconvergence.lib import nvsdlib from neutron.plugins.oneconvergence.lib import nvsdlib
from neutron.tests import base from neutron.tests import base

View File

@ -13,9 +13,9 @@
# under the License. # under the License.
import mock import mock
from oslo.serialization import jsonutils
import requests import requests
from neutron.openstack.common import jsonutils
from neutron.plugins.oneconvergence.lib import config # noqa from neutron.plugins.oneconvergence.lib import config # noqa
from neutron.plugins.oneconvergence.lib import plugin_helper as client from neutron.plugins.oneconvergence.lib import plugin_helper as client
from neutron.tests import base from neutron.tests import base

View File

@ -20,6 +20,7 @@ import uuid
import mock import mock
import netaddr import netaddr
from oslo.config import cfg from oslo.config import cfg
from oslo.serialization import jsonutils
from testtools import matchers from testtools import matchers
import webob.exc import webob.exc
@ -34,7 +35,6 @@ from neutron.db import l3_db
from neutron.db import securitygroups_db from neutron.db import securitygroups_db
from neutron.extensions import portbindings from neutron.extensions import portbindings
from neutron.extensions import securitygroup as ext_sg from neutron.extensions import securitygroup as ext_sg
from neutron.openstack.common import jsonutils
from neutron.tests.unit import _test_extension_portbindings as test_bindings from neutron.tests.unit import _test_extension_portbindings as test_bindings
from neutron.tests.unit import test_db_plugin as test_plugin from neutron.tests.unit import test_db_plugin as test_plugin
from neutron.tests.unit import test_extension_security_group as test_sg from neutron.tests.unit import test_extension_security_group as test_sg

View File

@ -17,13 +17,13 @@ import re
import contextlib import contextlib
import mock import mock
from oslo.config import cfg from oslo.config import cfg
from oslo.serialization import jsonutils
from six.moves import queue as Queue from six.moves import queue as Queue
from neutron.api.v2 import attributes from neutron.api.v2 import attributes
from neutron import context from neutron import context
from neutron.extensions import loadbalancer from neutron.extensions import loadbalancer
from neutron import manager from neutron import manager
from neutron.openstack.common import jsonutils
from neutron.plugins.common import constants from neutron.plugins.common import constants
from neutron.services.loadbalancer.drivers.radware import driver from neutron.services.loadbalancer.drivers.radware import driver
from neutron.services.loadbalancer.drivers.radware import exceptions as r_exc from neutron.services.loadbalancer.drivers.radware import exceptions as r_exc

View File

@ -16,6 +16,7 @@
import abc import abc
import mock import mock
from oslo.serialization import jsonutils
import routes import routes
import webob import webob
import webtest import webtest
@ -24,7 +25,6 @@ from neutron.api import extensions
from neutron.common import config from neutron.common import config
from neutron.common import exceptions from neutron.common import exceptions
from neutron.db import db_base_plugin_v2 from neutron.db import db_base_plugin_v2
from neutron.openstack.common import jsonutils
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging
from neutron.plugins.common import constants from neutron.plugins.common import constants
from neutron.tests import base from neutron.tests import base

View File

@ -12,9 +12,9 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from oslo.serialization import jsonutils
import six.moves.urllib.parse as urlparse import six.moves.urllib.parse as urlparse
from neutron.openstack.common import jsonutils
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging
from neutron.openstack.common import uuidutils from neutron.openstack.common import uuidutils
from neutron.plugins.vmware.api_client import exception as api_exc from neutron.plugins.vmware.api_client import exception as api_exc

View File

@ -15,8 +15,8 @@
# #
import mock import mock
from oslo.serialization import jsonutils
from neutron.openstack.common import jsonutils
from neutron.plugins.vmware.api_client import exception from neutron.plugins.vmware.api_client import exception
from neutron.plugins.vmware.common import utils as nsx_utils from neutron.plugins.vmware.common import utils as nsx_utils
from neutron.plugins.vmware import nsxlib from neutron.plugins.vmware import nsxlib

View File

@ -14,9 +14,9 @@
# limitations under the License. # limitations under the License.
import mock import mock
from oslo.serialization import jsonutils
from neutron.common import exceptions from neutron.common import exceptions
from neutron.openstack.common import jsonutils
from neutron.plugins.vmware.api_client import exception as api_exc from neutron.plugins.vmware.api_client import exception as api_exc
from neutron.plugins.vmware.common import exceptions as nsx_exc from neutron.plugins.vmware.common import exceptions as nsx_exc
from neutron.plugins.vmware.common import utils from neutron.plugins.vmware.common import utils

View File

@ -19,13 +19,13 @@ import time
import mock import mock
from oslo.config import cfg from oslo.config import cfg
from oslo.serialization import jsonutils
from neutron.api.v2 import attributes as attr from neutron.api.v2 import attributes as attr
from neutron.common import constants from neutron.common import constants
from neutron.common import exceptions as n_exc from neutron.common import exceptions as n_exc
from neutron import context from neutron import context
from neutron.extensions import l3 from neutron.extensions import l3
from neutron.openstack.common import jsonutils
from neutron.openstack.common import log from neutron.openstack.common import log
from neutron.plugins.vmware.api_client import client from neutron.plugins.vmware.api_client import client
from neutron.plugins.vmware.api_client import exception as api_exc from neutron.plugins.vmware.api_client import exception as api_exc

View File

@ -14,7 +14,8 @@
import copy import copy
from neutron.openstack.common import jsonutils from oslo.serialization import jsonutils
from neutron.openstack.common import uuidutils from neutron.openstack.common import uuidutils
from neutron.plugins.vmware.vshield.common import exceptions from neutron.plugins.vmware.vshield.common import exceptions

View File

@ -28,6 +28,7 @@ import time
import eventlet.wsgi import eventlet.wsgi
eventlet.patcher.monkey_patch(all=False, socket=True, thread=True) eventlet.patcher.monkey_patch(all=False, socket=True, thread=True)
from oslo.config import cfg from oslo.config import cfg
from oslo.serialization import jsonutils
import routes.middleware import routes.middleware
import webob.dec import webob.dec
import webob.exc import webob.exc
@ -37,7 +38,6 @@ from neutron import context
from neutron.db import api from neutron.db import api
from neutron.openstack.common import excutils from neutron.openstack.common import excutils
from neutron.openstack.common import gettextutils from neutron.openstack.common import gettextutils
from neutron.openstack.common import jsonutils
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging
from neutron.openstack.common import service as common_service from neutron.openstack.common import service as common_service
from neutron.openstack.common import systemd from neutron.openstack.common import systemd

View File

@ -9,7 +9,6 @@ module=fixture
module=gettextutils module=gettextutils
module=importutils module=importutils
module=install_venv_common module=install_venv_common
module=jsonutils
module=local module=local
module=lockutils module=lockutils
module=log module=log