Switch to nova's jsonutils in oslo.serialization
Very simple import change in each file, just touches a whole lot of files. jsonutils has graduated into a stand alone library and has been removed from the oslo-incubator repository. We should be using the library for all projects. Change-Id: I09d780a47d377871f357654603ee4b0fa0169d66
This commit is contained in:
parent
52fd9300c2
commit
5e8ce0bbde
@ -17,13 +17,13 @@ Common Auth Middleware.
|
||||
"""
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
import webob.dec
|
||||
import webob.exc
|
||||
|
||||
from nova import context
|
||||
from nova.i18n import _
|
||||
from nova.i18n import _LW
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common.middleware import request_id
|
||||
from nova import wsgi
|
||||
|
@ -20,6 +20,7 @@ Starting point for routing EC2 requests.
|
||||
|
||||
from eventlet.green import httplib
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import importutils
|
||||
from oslo.utils import timeutils
|
||||
import six
|
||||
@ -38,7 +39,6 @@ from nova.i18n import _
|
||||
from nova.i18n import _LE
|
||||
from nova.i18n import _LW
|
||||
from nova.openstack.common import context as common_context
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common import memorycache
|
||||
from nova import utils
|
||||
|
@ -21,6 +21,7 @@ import os
|
||||
import posixpath
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import importutils
|
||||
from oslo.utils import timeutils
|
||||
|
||||
@ -33,7 +34,6 @@ from nova import context
|
||||
from nova import network
|
||||
from nova import objects
|
||||
from nova.objects import base as obj_base
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
from nova import utils
|
||||
from nova.virt import netutils
|
||||
|
@ -18,10 +18,10 @@
|
||||
import errno
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
|
||||
from nova.api.metadata import base
|
||||
from nova.i18n import _LW
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
|
||||
file_opt = cfg.StrOpt('vendordata_jsonfile_path',
|
||||
|
@ -12,6 +12,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from oslo.serialization import jsonutils
|
||||
import six
|
||||
import webob
|
||||
|
||||
@ -21,7 +22,6 @@ from nova.api.openstack import xmlutil
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
import contextlib
|
||||
from xml.dom import minidom
|
||||
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
from webob import exc
|
||||
|
||||
@ -32,7 +33,6 @@ from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova.network.security_group import neutron_driver
|
||||
from nova.network.security_group import openstack_driver
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.virt import netutils
|
||||
|
||||
|
@ -38,6 +38,7 @@ import math
|
||||
import re
|
||||
import time
|
||||
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import importutils
|
||||
import webob.dec
|
||||
import webob.exc
|
||||
@ -46,7 +47,6 @@ from nova.api.openstack.compute.views import limits as limits_views
|
||||
from nova.api.openstack import wsgi
|
||||
from nova.api.openstack import xmlutil
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import quota
|
||||
from nova import utils
|
||||
from nova import wsgi as base_wsgi
|
||||
|
@ -14,6 +14,7 @@
|
||||
# under the License.
|
||||
|
||||
|
||||
from oslo.serialization import jsonutils
|
||||
import webob.exc
|
||||
|
||||
from nova.api.openstack import extensions
|
||||
@ -21,7 +22,6 @@ from nova.api.openstack import wsgi
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova import objects
|
||||
from nova.openstack.common import jsonutils
|
||||
|
||||
|
||||
ALIAS = 'os-pci'
|
||||
|
@ -16,6 +16,8 @@
|
||||
|
||||
"""The security groups extension."""
|
||||
|
||||
from oslo.serialization import jsonutils
|
||||
|
||||
from nova.api.openstack.compute.schemas.v3 import security_groups as \
|
||||
schema_security_groups
|
||||
from nova.api.openstack import extensions
|
||||
@ -25,7 +27,6 @@ from nova.compute import api as compute_api
|
||||
from nova import exception
|
||||
from nova.network.security_group import neutron_driver
|
||||
from nova.network.security_group import openstack_driver
|
||||
from nova.openstack.common import jsonutils
|
||||
|
||||
|
||||
ALIAS = 'os-security-groups'
|
||||
|
@ -20,6 +20,7 @@ import time
|
||||
from xml.dom import minidom
|
||||
|
||||
from lxml import etree
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import strutils
|
||||
import six
|
||||
import webob
|
||||
@ -30,7 +31,6 @@ from nova import i18n
|
||||
from nova.i18n import _
|
||||
from nova.i18n import _LE
|
||||
from nova.i18n import _LI
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
from nova import utils
|
||||
from nova import wsgi
|
||||
|
@ -20,8 +20,8 @@ Base RPC client and server common to all services.
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo import messaging
|
||||
from oslo.serialization import jsonutils
|
||||
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import rpc
|
||||
|
||||
|
||||
|
@ -32,6 +32,7 @@ import traceback
|
||||
from eventlet import queue
|
||||
from oslo.config import cfg
|
||||
from oslo import messaging
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import excutils
|
||||
from oslo.utils import importutils
|
||||
from oslo.utils import timeutils
|
||||
@ -51,7 +52,6 @@ from nova.i18n import _
|
||||
from nova.network import model as network_model
|
||||
from nova import objects
|
||||
from nova.objects import base as objects_base
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common import uuidutils
|
||||
from nova import rpc
|
||||
|
@ -25,11 +25,11 @@ messging module.
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo import messaging
|
||||
from oslo.serialization import jsonutils
|
||||
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova.objects import base as objects_base
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
from nova import rpc
|
||||
|
||||
|
@ -23,6 +23,7 @@ import time
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo.db import exception as db_exc
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import timeutils
|
||||
from oslo.utils import units
|
||||
|
||||
@ -32,7 +33,6 @@ from nova.db import base
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import fileutils
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
from nova import rpc
|
||||
from nova import utils
|
||||
|
@ -25,6 +25,7 @@ import sys
|
||||
import traceback
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import importutils
|
||||
|
||||
from nova.conductor import rpcapi as conductor_rpcapi
|
||||
@ -36,7 +37,6 @@ from nova.i18n import _
|
||||
from nova.network import rpcapi as network_rpcapi
|
||||
from nova import objects
|
||||
from nova.objects import base as objects_base
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
from nova import rpc
|
||||
|
||||
|
@ -26,6 +26,7 @@ import string
|
||||
import uuid
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import excutils
|
||||
from oslo.utils import strutils
|
||||
from oslo.utils import timeutils
|
||||
@ -59,7 +60,6 @@ from nova import objects
|
||||
from nova.objects import base as obj_base
|
||||
from nova.objects import quotas as quotas_obj
|
||||
from nova.objects import security_group as security_group_obj
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common import uuidutils
|
||||
from nova.pci import pci_request
|
||||
|
@ -17,12 +17,13 @@
|
||||
Claim objects for use with resource tracking.
|
||||
"""
|
||||
|
||||
from oslo.serialization import jsonutils
|
||||
|
||||
from nova import context
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova import objects
|
||||
from nova.objects import base as obj_base
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.virt import hardware
|
||||
|
||||
|
@ -40,6 +40,7 @@ from eventlet import greenthread
|
||||
import eventlet.timeout
|
||||
from oslo.config import cfg
|
||||
from oslo import messaging
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import excutils
|
||||
from oslo.utils import strutils
|
||||
from oslo.utils import timeutils
|
||||
@ -75,7 +76,6 @@ from nova import objects
|
||||
from nova.objects import base as obj_base
|
||||
from nova.objects import instance as instance_obj
|
||||
from nova.objects import quotas as quotas_obj
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common import periodic_task
|
||||
from nova import paths
|
||||
|
@ -21,6 +21,7 @@ model.
|
||||
import copy
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import importutils
|
||||
|
||||
from nova.compute import claims
|
||||
@ -34,7 +35,6 @@ from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova import objects
|
||||
from nova.objects import base as obj_base
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.pci import pci_manager
|
||||
from nova import rpc
|
||||
|
@ -18,12 +18,12 @@ Client side of the compute RPC API.
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo import messaging
|
||||
from oslo.serialization import jsonutils
|
||||
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova import objects
|
||||
from nova.objects import base as objects_base
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import rpc
|
||||
|
||||
rpcapi_opts = [
|
||||
|
@ -13,10 +13,11 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from oslo.serialization import jsonutils
|
||||
|
||||
from nova.compute import task_states
|
||||
from nova.compute import vm_states
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import jsonutils
|
||||
|
||||
|
||||
class Stats(dict):
|
||||
|
@ -18,6 +18,7 @@ import copy
|
||||
import itertools
|
||||
|
||||
from oslo import messaging
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import excutils
|
||||
from oslo.utils import timeutils
|
||||
import six
|
||||
@ -41,7 +42,6 @@ from nova.network.security_group import openstack_driver
|
||||
from nova import notifications
|
||||
from nova import objects
|
||||
from nova.objects import base as nova_object
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
from nova import quota
|
||||
from nova.scheduler import client as scheduler_client
|
||||
|
@ -17,9 +17,9 @@
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo import messaging
|
||||
from oslo.serialization import jsonutils
|
||||
|
||||
from nova.objects import base as objects_base
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import rpc
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
@ -18,10 +18,10 @@
|
||||
import base64
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
|
||||
from nova import exception
|
||||
from nova.i18n import _LW
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.virt.vmwareapi import vim_util
|
||||
|
||||
|
@ -20,13 +20,13 @@ import time
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo import messaging
|
||||
from oslo.serialization import jsonutils
|
||||
|
||||
from nova.cells import rpcapi as cells_rpcapi
|
||||
from nova.compute import rpcapi as compute_rpcapi
|
||||
from nova.i18n import _, _LW
|
||||
from nova import manager
|
||||
from nova import objects
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common import memorycache
|
||||
|
||||
|
@ -26,6 +26,7 @@ import time
|
||||
import glanceclient
|
||||
import glanceclient.exc
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import timeutils
|
||||
import six
|
||||
import six.moves.urllib.parse as urlparse
|
||||
@ -33,7 +34,6 @@ import six.moves.urllib.parse as urlparse
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
import nova.image.download as image_xfers
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
from nova import utils
|
||||
|
||||
|
@ -24,6 +24,7 @@ import re
|
||||
|
||||
import netaddr
|
||||
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
|
||||
@ -33,7 +34,6 @@ from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova import objects
|
||||
from nova.openstack.common import fileutils
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common import processutils
|
||||
from nova import paths
|
||||
|
@ -17,11 +17,11 @@ import functools
|
||||
|
||||
import eventlet
|
||||
import netaddr
|
||||
from oslo.serialization import jsonutils
|
||||
import six
|
||||
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import jsonutils
|
||||
|
||||
|
||||
def ensure_string_keys(d):
|
||||
|
@ -18,9 +18,9 @@ Client side of the network RPC API.
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo import messaging
|
||||
from oslo.serialization import jsonutils
|
||||
|
||||
from nova.objects import base as objects_base
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import rpc
|
||||
|
||||
rpcapi_opts = [
|
||||
|
@ -12,12 +12,13 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from oslo.serialization import jsonutils
|
||||
|
||||
from nova import db
|
||||
from nova import exception
|
||||
from nova import objects
|
||||
from nova.objects import base
|
||||
from nova.objects import fields
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import utils
|
||||
|
||||
|
||||
|
@ -10,10 +10,11 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from oslo.serialization import jsonutils
|
||||
|
||||
from nova import db
|
||||
from nova.objects import base
|
||||
from nova.objects import fields
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import utils
|
||||
|
||||
|
||||
|
@ -13,11 +13,12 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from oslo.serialization import jsonutils
|
||||
|
||||
from nova import db
|
||||
from nova import objects
|
||||
from nova.objects import base
|
||||
from nova.objects import fields
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
from nova import utils
|
||||
|
||||
|
@ -1,202 +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
|
||||
|
||||
is_simplejson = False
|
||||
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
|
||||
# NOTE(mriedem): Make sure we have a new enough version of simplejson
|
||||
# to support the namedobject_as_tuple argument. This can be removed
|
||||
# in the Kilo release when python 2.6 support is dropped.
|
||||
if 'namedtuple_as_object' in inspect.getargspec(json.dumps).args:
|
||||
is_simplejson = True
|
||||
else:
|
||||
import json
|
||||
except ImportError:
|
||||
import json
|
||||
else:
|
||||
import json
|
||||
|
||||
import six
|
||||
import six.moves.xmlrpc_client as xmlrpclib
|
||||
|
||||
from nova.openstack.common import gettextutils
|
||||
from nova.openstack.common import importutils
|
||||
from nova.openstack.common import strutils
|
||||
from nova.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):
|
||||
if is_simplejson:
|
||||
kwargs['namedtuple_as_object'] = False
|
||||
return json.dumps(value, default=default, **kwargs)
|
||||
|
||||
|
||||
def dump(obj, fp, *args, **kwargs):
|
||||
if is_simplejson:
|
||||
kwargs['namedtuple_as_object'] = False
|
||||
return json.dump(obj, fp, *args, **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__)
|
@ -14,8 +14,9 @@
|
||||
import ast
|
||||
import re
|
||||
|
||||
from oslo.serialization import jsonutils
|
||||
|
||||
from nova import exception
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.pci import pci_utils
|
||||
|
||||
MAX_VENDOR_ID = 0xFFFF
|
||||
|
@ -40,11 +40,11 @@ import copy
|
||||
|
||||
import jsonschema
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
import six
|
||||
|
||||
from nova import exception
|
||||
from nova import objects
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.pci import pci_utils
|
||||
|
||||
|
@ -16,9 +16,10 @@
|
||||
|
||||
import copy
|
||||
|
||||
from oslo.serialization import jsonutils
|
||||
|
||||
from nova import exception
|
||||
from nova.i18n import _LE
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.pci import pci_utils
|
||||
from nova.pci import pci_whitelist
|
||||
|
@ -28,10 +28,10 @@ __all__ = [
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo import messaging
|
||||
from oslo.serialization import jsonutils
|
||||
|
||||
import nova.context
|
||||
import nova.exception
|
||||
from nova.openstack.common import jsonutils
|
||||
|
||||
CONF = cfg.CONF
|
||||
TRANSPORT = None
|
||||
|
@ -18,7 +18,8 @@
|
||||
Manage hosts in the current zone.
|
||||
"""
|
||||
|
||||
from nova.openstack.common import jsonutils
|
||||
from oslo.serialization import jsonutils
|
||||
|
||||
from nova.scheduler import host_manager
|
||||
|
||||
|
||||
|
@ -13,9 +13,9 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from oslo.serialization import jsonutils
|
||||
import six
|
||||
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.scheduler import filters
|
||||
from nova.scheduler.filters import extra_specs_ops
|
||||
|
@ -16,9 +16,9 @@
|
||||
|
||||
import operator
|
||||
|
||||
from oslo.serialization import jsonutils
|
||||
import six
|
||||
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.scheduler import filters
|
||||
|
||||
|
||||
|
@ -44,12 +44,12 @@ the Open Attestation project at:
|
||||
"""
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import timeutils
|
||||
import requests
|
||||
|
||||
from nova import context
|
||||
from nova import db
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.scheduler import filters
|
||||
|
||||
|
@ -21,6 +21,7 @@ import collections
|
||||
import UserDict
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import timeutils
|
||||
|
||||
from nova.compute import task_states
|
||||
@ -28,7 +29,6 @@ from nova.compute import vm_states
|
||||
from nova import db
|
||||
from nova import exception
|
||||
from nova.i18n import _, _LW
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.pci import pci_stats
|
||||
from nova.scheduler import filters
|
||||
|
@ -22,9 +22,9 @@ ram from a host / node as it is supporting Baremetal hosts, which can not be
|
||||
subdivided into multiple instances.
|
||||
"""
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import timeutils
|
||||
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
import nova.scheduler.base_baremetal_host_manager as bbhm
|
||||
from nova.scheduler import host_manager
|
||||
|
@ -21,6 +21,7 @@ Scheduler Service
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo import messaging
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import excutils
|
||||
from oslo.utils import importutils
|
||||
|
||||
@ -30,7 +31,6 @@ from nova.compute import vm_states
|
||||
from nova import exception
|
||||
from nova import manager
|
||||
from nova import objects
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common import periodic_task
|
||||
from nova import quota
|
||||
|
@ -24,11 +24,11 @@ import datetime
|
||||
import os
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import excutils
|
||||
from oslo.utils import timeutils
|
||||
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
import sys
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
|
||||
from nova.compute import flavors
|
||||
from nova.compute import utils as compute_utils
|
||||
@ -25,7 +26,6 @@ from nova import exception
|
||||
from nova.i18n import _, _LW
|
||||
from nova import notifications
|
||||
from nova.objects import base as obj_base
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
from nova import rpc
|
||||
|
||||
|
@ -13,10 +13,9 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova.openstack.common import jsonutils
|
||||
|
||||
|
||||
def webob_factory(url):
|
||||
"""Factory for removing duplicate webob code from tests."""
|
||||
|
@ -12,6 +12,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import timeutils
|
||||
import webob
|
||||
|
||||
@ -24,7 +25,6 @@ from nova.compute import vm_states
|
||||
import nova.context
|
||||
from nova import exception
|
||||
from nova import objects
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import uuidutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
|
@ -13,13 +13,13 @@
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova.api.openstack.compute.plugins.v3 import admin_password \
|
||||
as admin_password_v21
|
||||
from nova.compute import api as compute_api
|
||||
from nova import exception
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
|
||||
|
@ -15,6 +15,7 @@
|
||||
|
||||
import mock
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
|
||||
from nova.api.openstack.compute.contrib import attach_interfaces \
|
||||
as attach_interfaces_v2
|
||||
@ -25,7 +26,6 @@ from nova import context
|
||||
from nova import exception
|
||||
from nova.network import api as network_api
|
||||
from nova import objects
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests import fake_network_cache_model
|
||||
|
||||
|
@ -16,6 +16,7 @@ import datetime
|
||||
|
||||
from lxml import etree
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova.api.openstack.compute.contrib import availability_zone as az_v2
|
||||
@ -30,7 +31,6 @@ from nova.compute import flavors
|
||||
from nova import context
|
||||
from nova import db
|
||||
from nova import exception
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import servicegroup
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
|
@ -16,6 +16,7 @@
|
||||
import mock
|
||||
import mox
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
from webob import exc
|
||||
|
||||
from nova.api.openstack.compute import extensions
|
||||
@ -27,7 +28,6 @@ from nova import block_device
|
||||
from nova.compute import api as compute_api
|
||||
from nova import exception
|
||||
from nova import objects
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
from nova.tests.image import fake
|
||||
|
@ -16,6 +16,7 @@
|
||||
import mock
|
||||
import mox
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
from webob import exc
|
||||
|
||||
from nova.api.openstack.compute import extensions
|
||||
@ -26,7 +27,6 @@ from nova.api.openstack.compute.plugins.v3 import servers as servers_v3
|
||||
from nova.api.openstack.compute import servers as servers_v2
|
||||
from nova.compute import api as compute_api
|
||||
from nova import exception
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
from nova.tests.image import fake
|
||||
|
@ -16,6 +16,7 @@
|
||||
import datetime
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova.api.openstack.compute.contrib import config_drive as config_drive_v2
|
||||
@ -29,7 +30,6 @@ from nova.compute import api as compute_api
|
||||
from nova.compute import flavors
|
||||
from nova import db
|
||||
from nova import exception
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
from nova.tests import fake_instance
|
||||
|
@ -14,11 +14,11 @@
|
||||
# under the License.
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova.consoleauth import rpcapi as consoleauth_rpcapi
|
||||
from nova import context
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
|
||||
|
@ -15,9 +15,10 @@
|
||||
|
||||
import string
|
||||
|
||||
from oslo.serialization import jsonutils
|
||||
|
||||
from nova.compute import api as compute_api
|
||||
from nova import exception
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
from nova.tests import fake_instance
|
||||
|
@ -14,11 +14,11 @@
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova.compute import api as compute_api
|
||||
from nova import exception
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
|
||||
|
@ -16,12 +16,12 @@
|
||||
import base64
|
||||
from xml.dom import minidom
|
||||
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova.compute import api as compute_api
|
||||
from nova import db
|
||||
from nova import exception
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
|
||||
|
@ -15,11 +15,12 @@
|
||||
|
||||
import datetime
|
||||
|
||||
from oslo.serialization import jsonutils
|
||||
|
||||
from nova.api.openstack import compute
|
||||
from nova.compute import api as compute_api
|
||||
from nova import db
|
||||
from nova import objects
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
from nova.tests import fake_instance
|
||||
|
@ -15,13 +15,13 @@
|
||||
import uuid
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova.compute import api as compute_api
|
||||
from nova.compute import vm_states
|
||||
from nova import context
|
||||
from nova import exception
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
from nova.tests import fake_instance
|
||||
|
@ -14,6 +14,7 @@
|
||||
# under the License.
|
||||
|
||||
from lxml import etree
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova.api.openstack.compute.contrib import extended_availability_zone
|
||||
@ -24,7 +25,6 @@ from nova import db
|
||||
from nova import exception
|
||||
from nova import objects
|
||||
from nova.objects import instance as instance_obj
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
from nova.tests import fake_instance
|
||||
|
@ -15,12 +15,12 @@
|
||||
import uuid
|
||||
|
||||
import mock
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova.compute import vm_states
|
||||
from nova import context
|
||||
from nova.objects import instance as instance_obj
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
from nova.tests import fake_instance
|
||||
|
@ -14,6 +14,7 @@
|
||||
# under the License.
|
||||
|
||||
from lxml import etree
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova.api.openstack.compute.contrib import extended_ips
|
||||
@ -21,7 +22,6 @@ from nova.api.openstack import xmlutil
|
||||
from nova import compute
|
||||
from nova import objects
|
||||
from nova.objects import instance as instance_obj
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
from nova.tests import fake_instance
|
||||
|
@ -14,6 +14,7 @@
|
||||
# under the License.
|
||||
|
||||
from lxml import etree
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova.api.openstack.compute.contrib import extended_ips_mac
|
||||
@ -21,7 +22,6 @@ from nova.api.openstack import xmlutil
|
||||
from nova import compute
|
||||
from nova import objects
|
||||
from nova.objects import instance as instance_obj
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
from nova.tests import fake_instance
|
||||
|
@ -14,6 +14,7 @@
|
||||
# under the License.
|
||||
|
||||
from lxml import etree
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova.api.openstack.compute.contrib import extended_server_attributes
|
||||
@ -22,7 +23,6 @@ from nova import db
|
||||
from nova import exception
|
||||
from nova import objects
|
||||
from nova.objects import instance as instance_obj
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
|
||||
|
@ -14,6 +14,7 @@
|
||||
# under the License.
|
||||
|
||||
from lxml import etree
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova.api.openstack.compute.contrib import extended_status
|
||||
@ -22,7 +23,6 @@ from nova import db
|
||||
from nova import exception
|
||||
from nova import objects
|
||||
from nova.objects import instance as instance_obj
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
from nova.tests import fake_instance
|
||||
|
@ -14,13 +14,13 @@
|
||||
# under the License.
|
||||
|
||||
from lxml import etree
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova.api.openstack.compute.contrib import extended_virtual_interfaces_net
|
||||
from nova.api.openstack import wsgi
|
||||
from nova import compute
|
||||
from nova import network
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
|
||||
|
@ -14,6 +14,7 @@
|
||||
# under the License.
|
||||
|
||||
from lxml import etree
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova.api.openstack.compute.contrib import extended_volumes
|
||||
@ -21,7 +22,6 @@ from nova import compute
|
||||
from nova import db
|
||||
from nova import objects
|
||||
from nova.objects import instance as instance_obj
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
from nova.tests import fake_block_device
|
||||
|
@ -13,11 +13,11 @@
|
||||
# under the License.
|
||||
|
||||
from lxml import etree
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova.api.openstack.compute.contrib import flavor_disabled
|
||||
from nova.compute import flavors
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
import datetime
|
||||
|
||||
import mock
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova.api.openstack.compute.contrib import flavor_access
|
||||
@ -26,7 +27,6 @@ from nova.compute import flavors
|
||||
from nova import context
|
||||
from nova import db
|
||||
from nova import exception
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
|
||||
|
@ -13,10 +13,10 @@
|
||||
# under the License.
|
||||
|
||||
from lxml import etree
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova.compute import flavors
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
|
||||
|
@ -13,10 +13,10 @@
|
||||
# under the License.
|
||||
|
||||
from lxml import etree
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova.compute import flavors
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
|
||||
|
@ -15,10 +15,10 @@
|
||||
|
||||
import datetime
|
||||
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova.compute import flavors
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
|
||||
|
@ -19,6 +19,7 @@ import uuid
|
||||
|
||||
from lxml import etree
|
||||
import mock
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova.api.openstack.compute.contrib import floating_ips
|
||||
@ -29,7 +30,6 @@ from nova import context
|
||||
from nova import db
|
||||
from nova import exception
|
||||
from nova import network
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
from nova.tests import fake_network
|
||||
|
@ -16,6 +16,7 @@
|
||||
import itertools
|
||||
|
||||
from lxml import etree
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova.api.openstack import wsgi
|
||||
@ -25,7 +26,6 @@ from nova import db
|
||||
from nova import exception
|
||||
from nova import objects
|
||||
from nova.objects import instance as instance_obj
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
from nova.tests import fake_instance
|
||||
|
@ -14,11 +14,11 @@
|
||||
# under the License.
|
||||
|
||||
from lxml import etree
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova.api.openstack.compute.contrib import image_size
|
||||
from nova.image import glance
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
|
||||
|
@ -14,6 +14,7 @@
|
||||
# under the License.
|
||||
|
||||
from lxml import etree
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova.api.openstack.compute.contrib import keypairs as keypairs_v2
|
||||
@ -21,7 +22,6 @@ from nova.api.openstack.compute.plugins.v3 import keypairs as keypairs_v21
|
||||
from nova.api.openstack import wsgi
|
||||
from nova import db
|
||||
from nova import exception
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import policy as common_policy
|
||||
from nova import policy
|
||||
from nova import quota
|
||||
|
@ -14,12 +14,12 @@
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova import objects
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
|
||||
|
@ -19,6 +19,7 @@ import mock
|
||||
from neutronclient.common import exceptions as n_exc
|
||||
from neutronclient.neutron import v2_0 as neutronv20
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova.api.openstack.compute.contrib import security_groups
|
||||
@ -32,7 +33,6 @@ from nova.network import neutronv2
|
||||
from nova.network.neutronv2 import api as neutron_api
|
||||
from nova.network.security_group import neutron_driver
|
||||
from nova.objects import instance as instance_obj
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack.compute.contrib import test_security_groups
|
||||
from nova.tests.api.openstack import fakes
|
||||
|
@ -14,11 +14,11 @@
|
||||
|
||||
import mock
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
import datetime
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
|
||||
from nova.api.openstack import compute
|
||||
from nova.api.openstack.compute import plugins
|
||||
@ -25,7 +26,6 @@ from nova.api.openstack import extensions
|
||||
import nova.compute.api
|
||||
from nova.compute import flavors
|
||||
from nova import db
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
from nova.tests import fake_instance
|
||||
|
@ -17,6 +17,7 @@ from lxml import etree
|
||||
import mock
|
||||
import mox
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova.api.openstack.compute.contrib import security_groups as secgroups_v2
|
||||
@ -29,7 +30,6 @@ import nova.db
|
||||
from nova import exception
|
||||
from nova import objects
|
||||
from nova.objects import instance as instance_obj
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import quota
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
|
@ -14,13 +14,13 @@
|
||||
# under the License.
|
||||
from lxml import etree
|
||||
import mock
|
||||
from oslo.serialization import jsonutils
|
||||
|
||||
from nova.api.openstack import compute
|
||||
from nova.api.openstack.compute.contrib import server_diagnostics
|
||||
from nova.api.openstack import wsgi
|
||||
from nova.compute import api as compute_api
|
||||
from nova import exception
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
|
||||
|
@ -13,13 +13,13 @@
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova.api.openstack.compute.contrib import server_external_events
|
||||
from nova import context
|
||||
from nova import exception
|
||||
from nova import objects
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
|
||||
fake_instances = {
|
||||
|
@ -15,11 +15,11 @@
|
||||
|
||||
from lxml import etree
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova.api.metadata import password
|
||||
from nova import compute
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
from nova.tests import fake_instance
|
||||
|
@ -16,6 +16,7 @@
|
||||
import datetime
|
||||
|
||||
from lxml import etree
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import timeutils
|
||||
|
||||
from nova.api.openstack.compute.contrib import server_usage
|
||||
@ -24,7 +25,6 @@ from nova import db
|
||||
from nova import exception
|
||||
from nova import objects
|
||||
from nova.objects import instance as instance_obj
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
from nova.tests import fake_instance
|
||||
|
@ -17,6 +17,7 @@ import datetime
|
||||
|
||||
from lxml import etree
|
||||
import mock
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import timeutils
|
||||
import webob
|
||||
|
||||
@ -30,7 +31,6 @@ from nova import context
|
||||
from nova import db
|
||||
from nova import exception
|
||||
from nova import objects
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import policy as common_policy
|
||||
from nova import policy
|
||||
from nova import test
|
||||
|
@ -14,12 +14,12 @@
|
||||
# under the License.
|
||||
|
||||
from lxml import etree
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import timeutils
|
||||
import webob
|
||||
|
||||
from nova.api.openstack.compute.contrib import volumes
|
||||
from nova import context
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
from nova.volume import cinder
|
||||
|
@ -14,6 +14,7 @@
|
||||
# under the License.
|
||||
|
||||
from lxml import etree
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova.api.openstack.compute.contrib import virtual_interfaces
|
||||
@ -23,7 +24,6 @@ from nova.compute import api as compute_api
|
||||
from nova import context
|
||||
from nova import exception
|
||||
from nova import network
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
|
||||
|
@ -19,6 +19,7 @@ import datetime
|
||||
from lxml import etree
|
||||
import mock
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import timeutils
|
||||
import webob
|
||||
from webob import exc
|
||||
@ -34,7 +35,6 @@ from nova import context
|
||||
from nova import db
|
||||
from nova import exception
|
||||
from nova import objects
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
from nova.tests import fake_block_device
|
||||
|
@ -12,13 +12,13 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import timeutils
|
||||
import webob
|
||||
|
||||
from nova.compute import vm_states
|
||||
import nova.context
|
||||
from nova import exception
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import uuidutils
|
||||
from nova import test
|
||||
from nova.tests import fake_instance
|
||||
|
@ -12,6 +12,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from oslo.serialization import jsonutils
|
||||
|
||||
from nova.api.openstack.compute import plugins
|
||||
from nova.api.openstack.compute.plugins.v3 import access_ips
|
||||
from nova.api.openstack.compute.plugins.v3 import servers
|
||||
@ -20,7 +22,6 @@ from nova.compute import api as compute_api
|
||||
from nova import db
|
||||
from nova import exception
|
||||
from nova.objects import instance as instance_obj
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
from nova.tests.image import fake
|
||||
|
@ -13,9 +13,10 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from oslo.serialization import jsonutils
|
||||
|
||||
from nova.consoleauth import rpcapi as consoleauth_rpcapi
|
||||
from nova import context
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
|
||||
|
@ -14,6 +14,7 @@
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova.api.openstack.compute.plugins.v3 import extended_volumes
|
||||
@ -23,7 +24,6 @@ from nova import db
|
||||
from nova import exception
|
||||
from nova import objects
|
||||
from nova.objects import instance as instance_obj
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
from nova.tests import fake_block_device
|
||||
|
@ -17,6 +17,7 @@ import datetime
|
||||
import uuid
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova.api.openstack.compute import plugins
|
||||
@ -28,7 +29,6 @@ from nova.compute import flavors
|
||||
from nova import db
|
||||
from nova import exception
|
||||
from nova.network import manager
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
from nova.tests import fake_instance
|
||||
|
@ -13,6 +13,7 @@
|
||||
# under the License.
|
||||
|
||||
|
||||
from oslo.serialization import jsonutils
|
||||
from webob import exc
|
||||
|
||||
from nova.api.openstack.compute.plugins.v3 import pci
|
||||
@ -21,7 +22,6 @@ from nova import context
|
||||
from nova import db
|
||||
from nova import exception
|
||||
from nova import objects
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.pci import pci_device
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
|
@ -18,6 +18,7 @@ import uuid
|
||||
import mock
|
||||
import mox
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova.api.openstack.compute import plugins
|
||||
@ -30,7 +31,6 @@ from nova import db
|
||||
from nova import exception
|
||||
from nova.image import glance
|
||||
from nova import objects
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import uuidutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
|
@ -13,13 +13,13 @@
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova.api.openstack.compute.plugins.v3 import server_external_events
|
||||
from nova import context
|
||||
from nova import exception
|
||||
from nova import objects
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
|
||||
fake_instances = {
|
||||
|
@ -14,11 +14,11 @@
|
||||
# under the License.
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
import webob
|
||||
|
||||
from nova.api.metadata import password
|
||||
from nova import compute
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova import test
|
||||
from nova.tests.api.openstack import fakes
|
||||
from nova.tests import fake_instance
|
||||
|
@ -24,6 +24,7 @@ import iso8601
|
||||
import mock
|
||||
import mox
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import timeutils
|
||||
import six.moves.urllib.parse as urlparse
|
||||
import testtools
|
||||
@ -53,7 +54,6 @@ from nova.network import manager
|
||||
from nova.network.neutronv2 import api as neutron_api
|
||||
from nova import objects
|
||||
from nova.objects import instance as instance_obj
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import policy as common_policy
|
||||
from nova import policy
|
||||
from nova import test
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user