Remove the import pathing for the old structure

This commit is the result of running the following search and replace
across the project.
    s/nova\.api\.openstack\.?//g

Change-Id: I4974a28de541aace043504f788cf0d100f778cae
This commit is contained in:
EdLeafe 2018-08-30 23:07:27 +00:00 committed by Eric Fried
parent a3f8272300
commit 1dca56f58e
71 changed files with 282 additions and 282 deletions

View File

@ -13,7 +13,7 @@
import os
from nova.api.openstack.placement import handler
from placement import handler
# A humane ordering of HTTP methods for sorted output.
ORDERED_METHODS = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE']

View File

@ -70,17 +70,17 @@ near the surface. The goal of this is to make things easy to trace when
debugging or adding functionality.
Functionality which is required for every request is handled in raw WSGI
middleware that is composed in the `nova.api.openstack.placement.deploy`
middleware that is composed in the `placement.deploy`
module. Dispatch or routing is handled declaratively via the
``ROUTE_DECLARATIONS`` map defined in the
`nova.api.openstack.placement.handler` module.
`placement.handler` module.
Mapping is by URL plus request method. The destination is a complete WSGI
application, using a subclass of the `wsgify`_ method from `WebOb`_ to provide
a `Request`_ object that provides convenience methods for accessing request
headers, bodies, and query parameters and for generating responses. In the
placement API these mini-applications are called `handlers`. The `wsgify`
subclass is provided in `nova.api.openstack.placement.wsgi_wrapper` as
subclass is provided in `placement.wsgi_wrapper` as
`PlacementWsgify`. It is used to make sure that JSON formatted error responses
are structured according to the API-WG `errors`_ guideline.
@ -190,7 +190,7 @@ lower microversion should return a ``404``. When adding a new method to an
existing URL a request for a lower microversion should return a ``405``.
In either case, the ``ROUTE_DECLARATIONS`` dictionary in the
`nova.api.openstack.placement.handler` module should be updated to point to a
`placement.handler` module should be updated to point to a
function within a module that contains handlers for the type of entity
identified by the URL. Collection and individual entity handlers of the same
type should be in the same module.
@ -241,7 +241,7 @@ request, the caller is responsible for selecting the right one before calling
When a handler needs to read or write the data store it should use methods on
the objects found in the
`nova.api.openstack.placement.objects.resource_provider` package. Doing so
`placement.objects.resource_provider` package. Doing so
requires a context which is provided to the handler method via the WSGI
environment. It can be retrieved as follows::
@ -259,7 +259,7 @@ response. This can be used to distinguish different errors with the same HTTP
response status code (a common case is a generation conflict versus an
inventory in use conflict). Error codes are simple namespaced strings (e.g.,
``placement.inventory.inuse``) for which symbols are maintained in
``nova.api.openstack.placement.errors``. Adding a symbol to a response is done
``placement.errors``. Adding a symbol to a response is done
by using the ``comment`` kwarg to a WebOb exception, like this::
except exception.InventoryInUse as exc:
@ -269,7 +269,7 @@ by using the ``comment`` kwarg to a WebOb exception, like this::
Code that adds newly raised exceptions should include an error code. Find
additional guidelines on use in the docs for
``nova.api.openstack.placement.errors``.
``placement.errors``.
Testing of handler code is described in the next section.

View File

@ -17,7 +17,7 @@ from oslo_middleware import request_id
import webob.dec
import webob.exc
from nova.api.openstack.placement import context
from placement import context
LOG = logging.getLogger(__name__)

View File

@ -13,8 +13,8 @@
from oslo_context import context
from oslo_db.sqlalchemy import enginefacade
from nova.api.openstack.placement import exception
from nova.api.openstack.placement import policy
from placement import exception
from placement import policy
@enginefacade.transaction_context_provider
@ -36,7 +36,7 @@ class RequestContext(context.RequestContext):
{'project_id': self.project_id, 'user_id': self.user_id}
:param fatal: if False, will return False when an
exception.PolicyNotAuthorized occurs.
:raises nova.api.openstack.placement.exception.PolicyNotAuthorized:
:raises placement.exception.PolicyNotAuthorized:
if verification fails and fatal is True.
:return: returns a non-False value (not necessarily "True") if
authorized and False if not authorized and fatal is False.

View File

@ -24,7 +24,7 @@ from oslo_log import log as logging
import sqlalchemy
from sqlalchemy.sql import null
from nova.api.openstack.placement import db_api as placement_db
from placement import db_api as placement_db
from nova.db.sqlalchemy import api as db_session
from nova import exception
from nova.i18n import _

View File

@ -15,14 +15,14 @@ from microversion_parse import middleware as mp_middleware
import oslo_middleware
from oslo_middleware import cors
from nova.api.openstack.placement import auth
from nova.api.openstack.placement import db_api
from nova.api.openstack.placement import fault_wrap
from nova.api.openstack.placement import handler
from nova.api.openstack.placement import microversion
from nova.api.openstack.placement.objects import resource_provider
from nova.api.openstack.placement import requestlog
from nova.api.openstack.placement import util
from placement import auth
from placement import db_api
from placement import fault_wrap
from placement import handler
from placement import microversion
from placement.objects import resource_provider
from placement import requestlog
from placement import util
# TODO(cdent): NAME points to the config project being used, so for

View File

@ -25,7 +25,7 @@ from oslo_utils import uuidutils
import requests
from wsgi_intercept import interceptor
from nova.api.openstack.placement import deploy
from placement import deploy
class PlacementDirect(interceptor.RequestsInterceptor):

View File

@ -19,7 +19,7 @@ from oslo_log import log as logging
import six
from webob import exc
from nova.api.openstack.placement import util
from placement import util
LOG = logging.getLogger(__name__)

View File

@ -28,18 +28,18 @@ import webob
from oslo_log import log as logging
from nova.api.openstack.placement import exception
from nova.api.openstack.placement.handlers import aggregate
from nova.api.openstack.placement.handlers import allocation
from nova.api.openstack.placement.handlers import allocation_candidate
from nova.api.openstack.placement.handlers import inventory
from nova.api.openstack.placement.handlers import reshaper
from nova.api.openstack.placement.handlers import resource_class
from nova.api.openstack.placement.handlers import resource_provider
from nova.api.openstack.placement.handlers import root
from nova.api.openstack.placement.handlers import trait
from nova.api.openstack.placement.handlers import usage
from nova.api.openstack.placement import util
from placement import exception
from placement.handlers import aggregate
from placement.handlers import allocation
from placement.handlers import allocation_candidate
from placement.handlers import inventory
from placement.handlers import reshaper
from placement.handlers import resource_class
from placement.handlers import resource_provider
from placement.handlers import root
from placement.handlers import trait
from placement.handlers import usage
from placement import util
from nova.i18n import _
LOG = logging.getLogger(__name__)

View File

@ -17,14 +17,14 @@ from oslo_utils import encodeutils
from oslo_utils import timeutils
import webob
from nova.api.openstack.placement import errors
from nova.api.openstack.placement import exception
from nova.api.openstack.placement import microversion
from nova.api.openstack.placement.objects import resource_provider as rp_obj
from nova.api.openstack.placement.policies import aggregate as policies
from nova.api.openstack.placement.schemas import aggregate as schema
from nova.api.openstack.placement import util
from nova.api.openstack.placement import wsgi_wrapper
from placement import errors
from placement import exception
from placement import microversion
from placement.objects import resource_provider as rp_obj
from placement.policies import aggregate as policies
from placement.schemas import aggregate as schema
from placement import util
from placement import wsgi_wrapper
from nova.i18n import _

View File

@ -22,14 +22,14 @@ from oslo_utils import timeutils
from oslo_utils import uuidutils
import webob
from nova.api.openstack.placement import errors
from nova.api.openstack.placement import exception
from nova.api.openstack.placement import microversion
from nova.api.openstack.placement.objects import resource_provider as rp_obj
from nova.api.openstack.placement.policies import allocation as policies
from nova.api.openstack.placement.schemas import allocation as schema
from nova.api.openstack.placement import util
from nova.api.openstack.placement import wsgi_wrapper
from placement import errors
from placement import exception
from placement import microversion
from placement.objects import resource_provider as rp_obj
from placement.policies import allocation as policies
from placement.schemas import allocation as schema
from placement import util
from placement import wsgi_wrapper
from nova.i18n import _

View File

@ -20,14 +20,14 @@ from oslo_utils import timeutils
import six
import webob
from nova.api.openstack.placement import exception
from nova.api.openstack.placement import microversion
from nova.api.openstack.placement.objects import resource_provider as rp_obj
from nova.api.openstack.placement.policies import allocation_candidate as \
from placement import exception
from placement import microversion
from placement.objects import resource_provider as rp_obj
from placement.policies import allocation_candidate as \
policies
from nova.api.openstack.placement.schemas import allocation_candidate as schema
from nova.api.openstack.placement import util
from nova.api.openstack.placement import wsgi_wrapper
from placement.schemas import allocation_candidate as schema
from placement import util
from placement import wsgi_wrapper
from nova.i18n import _

View File

@ -19,14 +19,14 @@ from oslo_serialization import jsonutils
from oslo_utils import encodeutils
import webob
from nova.api.openstack.placement import errors
from nova.api.openstack.placement import exception
from nova.api.openstack.placement import microversion
from nova.api.openstack.placement.objects import resource_provider as rp_obj
from nova.api.openstack.placement.policies import inventory as policies
from nova.api.openstack.placement.schemas import inventory as schema
from nova.api.openstack.placement import util
from nova.api.openstack.placement import wsgi_wrapper
from placement import errors
from placement import exception
from placement import microversion
from placement.objects import resource_provider as rp_obj
from placement.policies import inventory as policies
from placement.schemas import inventory as schema
from placement import util
from placement import wsgi_wrapper
from nova.db import constants as db_const
from nova.i18n import _

View File

@ -22,18 +22,18 @@ import copy
from oslo_utils import excutils
import webob
from nova.api.openstack.placement import errors
from nova.api.openstack.placement import exception
from placement import errors
from placement import exception
# TODO(cdent): That we are doing this suggests that there's stuff to be
# extracted from the handler to a shared module.
from nova.api.openstack.placement.handlers import allocation
from nova.api.openstack.placement.handlers import inventory
from nova.api.openstack.placement import microversion
from nova.api.openstack.placement.objects import resource_provider as rp_obj
from nova.api.openstack.placement.policies import reshaper as policies
from nova.api.openstack.placement.schemas import reshaper as schema
from nova.api.openstack.placement import util
from nova.api.openstack.placement import wsgi_wrapper
from placement.handlers import allocation
from placement.handlers import inventory
from placement import microversion
from placement.objects import resource_provider as rp_obj
from placement.policies import reshaper as policies
from placement.schemas import reshaper as schema
from placement import util
from placement import wsgi_wrapper
# TODO(cdent): placement needs its own version of this
from nova.i18n import _

View File

@ -16,13 +16,13 @@ from oslo_utils import encodeutils
from oslo_utils import timeutils
import webob
from nova.api.openstack.placement import exception
from nova.api.openstack.placement import microversion
from nova.api.openstack.placement.objects import resource_provider as rp_obj
from nova.api.openstack.placement.policies import resource_class as policies
from nova.api.openstack.placement.schemas import resource_class as schema
from nova.api.openstack.placement import util
from nova.api.openstack.placement import wsgi_wrapper
from placement import exception
from placement import microversion
from placement.objects import resource_provider as rp_obj
from placement.policies import resource_class as policies
from placement.schemas import resource_class as schema
from placement import util
from placement import wsgi_wrapper
from nova.i18n import _

View File

@ -20,14 +20,14 @@ from oslo_utils import timeutils
from oslo_utils import uuidutils
import webob
from nova.api.openstack.placement import errors
from nova.api.openstack.placement import exception
from nova.api.openstack.placement import microversion
from nova.api.openstack.placement.objects import resource_provider as rp_obj
from nova.api.openstack.placement.policies import resource_provider as policies
from nova.api.openstack.placement.schemas import resource_provider as rp_schema
from nova.api.openstack.placement import util
from nova.api.openstack.placement import wsgi_wrapper
from placement import errors
from placement import exception
from placement import microversion
from placement.objects import resource_provider as rp_obj
from placement.policies import resource_provider as policies
from placement.schemas import resource_provider as rp_schema
from placement import util
from placement import wsgi_wrapper
from nova.i18n import _

View File

@ -16,8 +16,8 @@ from oslo_utils import encodeutils
from oslo_utils import timeutils
from nova.api.openstack.placement import microversion
from nova.api.openstack.placement import wsgi_wrapper
from placement import microversion
from placement import wsgi_wrapper
@wsgi_wrapper.PlacementWsgify

View File

@ -17,14 +17,14 @@ from oslo_utils import encodeutils
from oslo_utils import timeutils
import webob
from nova.api.openstack.placement import errors
from nova.api.openstack.placement import exception
from nova.api.openstack.placement import microversion
from nova.api.openstack.placement.objects import resource_provider as rp_obj
from nova.api.openstack.placement.policies import trait as policies
from nova.api.openstack.placement.schemas import trait as schema
from nova.api.openstack.placement import util
from nova.api.openstack.placement import wsgi_wrapper
from placement import errors
from placement import exception
from placement import microversion
from placement.objects import resource_provider as rp_obj
from placement.policies import trait as policies
from placement.schemas import trait as schema
from placement import util
from placement import wsgi_wrapper
from nova.i18n import _

View File

@ -16,13 +16,13 @@ from oslo_utils import encodeutils
from oslo_utils import timeutils
import webob
from nova.api.openstack.placement import exception
from nova.api.openstack.placement import microversion
from nova.api.openstack.placement.objects import resource_provider as rp_obj
from nova.api.openstack.placement.policies import usage as policies
from nova.api.openstack.placement.schemas import usage as schema
from nova.api.openstack.placement import util
from nova.api.openstack.placement import wsgi_wrapper
from placement import exception
from placement import microversion
from placement.objects import resource_provider as rp_obj
from placement.policies import usage as policies
from placement.schemas import usage as schema
from placement import util
from placement import wsgi_wrapper
from nova.i18n import _

View File

@ -15,10 +15,10 @@ from oslo_versionedobjects import base
from oslo_versionedobjects import fields
import sqlalchemy as sa
from nova.api.openstack.placement import db_api
from nova.api.openstack.placement import exception
from nova.api.openstack.placement.objects import project as project_obj
from nova.api.openstack.placement.objects import user as user_obj
from placement import db_api
from placement import exception
from placement.objects import project as project_obj
from placement.objects import user as user_obj
from nova.db.sqlalchemy import api_models as models
CONSUMER_TBL = models.Consumer.__table__
@ -67,7 +67,7 @@ def delete_consumers_if_no_allocations(ctx, consumer_uuids):
"""Looks to see if any of the supplied consumers has any allocations and if
not, deletes the consumer record entirely.
:param ctx: `nova.api.openstack.placement.context.RequestContext` that
:param ctx: `placement.context.RequestContext` that
contains an oslo_db Session
:param consumer_uuids: UUIDs of the consumers to check and maybe delete
"""

View File

@ -16,8 +16,8 @@ from oslo_versionedobjects import base
from oslo_versionedobjects import fields
import sqlalchemy as sa
from nova.api.openstack.placement import db_api
from nova.api.openstack.placement import exception
from placement import db_api
from placement import exception
from nova.db.sqlalchemy import api_models as models
CONF = cfg.CONF

View File

@ -37,12 +37,12 @@ from sqlalchemy import func
from sqlalchemy import sql
from sqlalchemy.sql import null
from nova.api.openstack.placement import db_api
from nova.api.openstack.placement import exception
from nova.api.openstack.placement.objects import consumer as consumer_obj
from nova.api.openstack.placement.objects import project as project_obj
from nova.api.openstack.placement.objects import user as user_obj
from nova.api.openstack.placement import resource_class_cache as rc_cache
from placement import db_api
from placement import exception
from placement.objects import consumer as consumer_obj
from placement.objects import project as project_obj
from placement.objects import user as user_obj
from placement import resource_class_cache as rc_cache
from nova.db.sqlalchemy import api_models as models
from nova.i18n import _
from nova import rc_fields
@ -3976,7 +3976,7 @@ class AllocationCandidates(base.VersionedObject):
:param context: Nova RequestContext.
:param requests: Dict, keyed by suffix, of
nova.api.openstack.placement.util.RequestGroup
placement.util.RequestGroup
:param limit: An integer, N, representing the maximum number of
allocation candidates to return. If
CONF.placement.randomize_allocation_candidates is True
@ -4010,7 +4010,7 @@ class AllocationCandidates(base.VersionedObject):
(or writer) context.
:param context: Nova RequestContext.
:param request: One nova.api.openstack.placement.util.RequestGroup
:param request: One placement.util.RequestGroup
:param sharing_providers: dict, keyed by resource class internal ID, of
the set of provider IDs containing shared
inventory of that resource class
@ -4169,7 +4169,7 @@ def reshape(ctx, inventories, allocations):
with the transaction context manager if we want all changes involved
in the sub-functions to operate within a single DB transaction.
:param ctx: `nova.api.openstack.placement.context.RequestContext` object
:param ctx: `placement.context.RequestContext` object
containing the DB transaction context.
:param inventories: dict, keyed by ResourceProvider, of `InventoryList`
objects representing the replaced inventory information

View File

@ -16,8 +16,8 @@ from oslo_versionedobjects import base
from oslo_versionedobjects import fields
import sqlalchemy as sa
from nova.api.openstack.placement import db_api
from nova.api.openstack.placement import exception
from placement import db_api
from placement import exception
from nova.db.sqlalchemy import api_models as models
CONF = cfg.CONF

View File

@ -12,16 +12,16 @@
import itertools
from nova.api.openstack.placement.policies import aggregate
from nova.api.openstack.placement.policies import allocation
from nova.api.openstack.placement.policies import allocation_candidate
from nova.api.openstack.placement.policies import base
from nova.api.openstack.placement.policies import inventory
from nova.api.openstack.placement.policies import reshaper
from nova.api.openstack.placement.policies import resource_class
from nova.api.openstack.placement.policies import resource_provider
from nova.api.openstack.placement.policies import trait
from nova.api.openstack.placement.policies import usage
from placement.policies import aggregate
from placement.policies import allocation
from placement.policies import allocation_candidate
from placement.policies import base
from placement.policies import inventory
from placement.policies import reshaper
from placement.policies import resource_class
from placement.policies import resource_provider
from placement.policies import trait
from placement.policies import usage
def list_rules():

View File

@ -13,7 +13,7 @@
from oslo_policy import policy
from nova.api.openstack.placement.policies import base
from placement.policies import base
PREFIX = 'placement:resource_providers:aggregates:%s'

View File

@ -13,7 +13,7 @@
from oslo_policy import policy
from nova.api.openstack.placement.policies import base
from placement.policies import base
RP_ALLOC_LIST = 'placement:resource_providers:allocations:list'

View File

@ -13,7 +13,7 @@
from oslo_policy import policy
from nova.api.openstack.placement.policies import base
from placement.policies import base
LIST = 'placement:allocation_candidates:list'

View File

@ -13,7 +13,7 @@
from oslo_policy import policy
from nova.api.openstack.placement.policies import base
from placement.policies import base
PREFIX = 'placement:resource_providers:inventories:%s'

View File

@ -13,7 +13,7 @@
from oslo_policy import policy
from nova.api.openstack.placement.policies import base
from placement.policies import base
PREFIX = 'placement:reshaper:%s'

View File

@ -13,7 +13,7 @@
from oslo_policy import policy
from nova.api.openstack.placement.policies import base
from placement.policies import base
PREFIX = 'placement:resource_classes:%s'

View File

@ -13,7 +13,7 @@
from oslo_policy import policy
from nova.api.openstack.placement.policies import base
from placement.policies import base
PREFIX = 'placement:resource_providers:%s'

View File

@ -13,7 +13,7 @@
from oslo_policy import policy
from nova.api.openstack.placement.policies import base
from placement.policies import base
RP_TRAIT_PREFIX = 'placement:resource_providers:traits:%s'

View File

@ -13,7 +13,7 @@
from oslo_policy import policy
from nova.api.openstack.placement.policies import base
from placement.policies import base
PROVIDER_USAGES = 'placement:resource_providers:usages'

View File

@ -16,8 +16,8 @@ from oslo_log import log as logging
from oslo_policy import policy
from oslo_utils import excutils
from nova.api.openstack.placement import exception
from nova.api.openstack.placement import policies
from placement import exception
from placement import policies
CONF = cfg.CONF
@ -63,7 +63,7 @@ def authorize(context, action, target, do_raise=True):
"""Verifies that the action is valid on the target in this context.
:param context: instance of
nova.api.openstack.placement.context.RequestContext
placement.context.RequestContext
:param action: string representing the action to be checked
this should be colon separated for clarity, i.e.
``placement:resource_providers:list``
@ -72,7 +72,7 @@ def authorize(context, action, target, do_raise=True):
owner of the object e.g. ``{'project_id': context.project_id}``.
:param do_raise: if True (the default), raises PolicyNotAuthorized;
if False, returns False
:raises nova.api.openstack.placement.exception.PolicyNotAuthorized: if
:raises placement.exception.PolicyNotAuthorized: if
verification fails and do_raise is True.
:returns: non-False value (not necessarily "True") if authorized, and the
exact value False if not authorized and do_raise is False.

View File

@ -14,7 +14,7 @@
from oslo_log import log as logging
from nova.api.openstack.placement import microversion
from placement import microversion
LOG = logging.getLogger(__name__)

View File

@ -13,8 +13,8 @@
from oslo_concurrency import lockutils
import sqlalchemy as sa
from nova.api.openstack.placement import db_api
from nova.api.openstack.placement import exception
from placement import db_api
from placement import exception
from nova.db.sqlalchemy import api_models as models
from nova import rc_fields as fields

View File

@ -13,7 +13,7 @@
import copy
from nova.api.openstack.placement.schemas import common
from placement.schemas import common
ALLOCATION_SCHEMA = {

View File

@ -13,7 +13,7 @@
import copy
from nova.api.openstack.placement.schemas import common
from placement.schemas import common
from nova.db import constants as db_const

View File

@ -13,9 +13,9 @@
import copy
from nova.api.openstack.placement.schemas import allocation
from nova.api.openstack.placement.schemas import common
from nova.api.openstack.placement.schemas import inventory
from placement.schemas import allocation
from placement.schemas import common
from placement.schemas import inventory
ALLOCATIONS = copy.deepcopy(allocation.POST_ALLOCATIONS_V1_28)

View File

@ -13,7 +13,7 @@
import copy
from nova.api.openstack.placement.schemas import common
from placement.schemas import common
POST_RC_SCHEMA_V1_2 = {

View File

@ -13,7 +13,7 @@
import copy
from nova.api.openstack.placement.schemas import common
from placement.schemas import common
TRAIT = {

View File

@ -49,7 +49,7 @@ from oslotest import moxstubout
import six
import testtools
from nova.api.openstack.placement.objects import resource_provider
from placement.objects import resource_provider
from nova import context
from nova.db import api as db
from nova import exception

View File

@ -39,9 +39,9 @@ from oslo_utils import uuidutils
from requests import adapters
from wsgi_intercept import interceptor
from nova.api.openstack.compute import tenant_networks
from nova.api.openstack.placement import db_api as placement_db
from nova.api.openstack import wsgi_app
from compute import tenant_networks
from placement import db_api as placement_db
from import wsgi_app
from nova.api import wsgi
from nova.compute import rpcapi as compute_rpcapi
from nova import context
@ -257,7 +257,7 @@ class DatabasePoisonFixture(fixtures.Fixture):
# nova.db.instance_get
#
# - mock at the api layer rather than the object layer, for example:
# nova.api.openstack.common.get_instance
# common.get_instance
# vs.
# nova.objects.instance.Instance.get
#

View File

@ -15,9 +15,9 @@ from oslo_config import fixture as config_fixture
from oslotest import output
import testtools
from nova.api.openstack.placement import context
from nova.api.openstack.placement import deploy
from nova.api.openstack.placement.objects import resource_provider
from placement import context
from placement import deploy
from placement.objects import resource_provider
from nova.tests import fixtures
from nova.tests.functional.fixtures import capture
from nova.tests.unit import policy_fixture

View File

@ -14,9 +14,9 @@ from oslo_config import cfg
import six
import sqlalchemy as sa
from nova.api.openstack.placement import exception
from nova.api.openstack.placement import lib as placement_lib
from nova.api.openstack.placement.objects import resource_provider as rp_obj
from placement import exception
from placement import lib as placement_lib
from placement.objects import resource_provider as rp_obj
from nova import rc_fields as fields
from nova.tests.functional.db import test_base as tb
from nova.tests import uuidsentinel as uuids

View File

@ -14,11 +14,11 @@
from oslo_utils import uuidutils
from nova.api.openstack.placement import exception
from nova.api.openstack.placement.objects import consumer as consumer_obj
from nova.api.openstack.placement.objects import project as project_obj
from nova.api.openstack.placement.objects import resource_provider as rp_obj
from nova.api.openstack.placement.objects import user as user_obj
from placement import exception
from placement.objects import consumer as consumer_obj
from placement.objects import project as project_obj
from placement.objects import resource_provider as rp_obj
from placement.objects import user as user_obj
from nova.tests.functional.api.openstack.placement import base
from nova.tests import uuidsentinel as uuids

View File

@ -13,12 +13,12 @@
from oslo_config import cfg
import sqlalchemy as sa
from nova.api.openstack.placement import db_api
from nova.api.openstack.placement import exception
from nova.api.openstack.placement.objects import consumer as consumer_obj
from nova.api.openstack.placement.objects import project as project_obj
from nova.api.openstack.placement.objects import resource_provider as rp_obj
from nova.api.openstack.placement.objects import user as user_obj
from placement import db_api
from placement import exception
from placement.objects import consumer as consumer_obj
from placement.objects import project as project_obj
from placement.objects import resource_provider as rp_obj
from placement.objects import user as user_obj
from nova import rc_fields as fields
from nova.tests.functional.api.openstack.placement import base
from nova.tests.functional.db import test_base as tb

View File

@ -10,8 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
from nova.api.openstack.placement import exception
from nova.api.openstack.placement.objects import project as project_obj
from placement import exception
from placement.objects import project as project_obj
from nova.tests.functional.db import test_base as tb
from nova.tests import uuidsentinel as uuids

View File

@ -10,9 +10,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from nova.api.openstack.placement import exception
from nova.api.openstack.placement.objects import consumer as consumer_obj
from nova.api.openstack.placement.objects import resource_provider as rp_obj
from placement import exception
from placement.objects import consumer as consumer_obj
from placement.objects import resource_provider as rp_obj
from nova.tests.functional.db import test_base as tb
from nova.tests import uuidsentinel as uuids

View File

@ -15,8 +15,8 @@ import mock
from oslo_utils import timeutils
from nova.api.openstack.placement import exception
from nova.api.openstack.placement import resource_class_cache as rc_cache
from placement import exception
from placement import resource_class_cache as rc_cache
from nova import rc_fields as fields
from nova.tests.functional.api.openstack.placement import base

View File

@ -18,9 +18,9 @@ from oslo_db import exception as db_exc
import sqlalchemy as sa
import nova
from nova.api.openstack.placement import exception
from nova.api.openstack.placement.objects import consumer as consumer_obj
from nova.api.openstack.placement.objects import resource_provider as rp_obj
from placement import exception
from placement.objects import consumer as consumer_obj
from placement.objects import resource_provider as rp_obj
from nova.db.sqlalchemy import api_models as models
from nova import rc_fields as fields
from nova.tests.functional.db import test_base as tb
@ -414,7 +414,7 @@ class ResourceProviderTestCase(tb.PlacementDbBaseTestCase):
# NOTE(jaypipes): This is just disabling the online data migration that
# occurs in _from_db_object() that sets root provider ID to ensure we
# don't have any migrations messing with the end result.
with mock.patch('nova.api.openstack.placement.objects.'
with mock.patch('placement.objects.'
'resource_provider._set_root_provider_id'):
rps = rp_obj.ResourceProviderList.get_all_by_filters(
self.ctx,
@ -553,7 +553,7 @@ class ResourceProviderTestCase(tb.PlacementDbBaseTestCase):
rp.set_inventory,
inv_list)
@mock.patch('nova.api.openstack.placement.objects.resource_provider.LOG')
@mock.patch('placement.objects.resource_provider.LOG')
def test_set_inventory_over_capacity(self, mock_log):
rp = self._create_provider(uuidsentinel.rp_name)
@ -707,7 +707,7 @@ class ResourceProviderTestCase(tb.PlacementDbBaseTestCase):
self.assertIn('No inventory of class DISK_GB found',
str(error))
@mock.patch('nova.api.openstack.placement.objects.resource_provider.LOG')
@mock.patch('placement.objects.resource_provider.LOG')
def test_update_inventory_violates_allocation(self, mock_log):
# Compute nodes that are reconfigured have to be able to set
# their inventory to something that violates allocations so
@ -1708,7 +1708,7 @@ class TestAllocationListCreateDelete(tb.PlacementDbBaseTestCase):
self.ctx, empty_rp)
self.assertEqual(0, len(allocations))
@mock.patch('nova.api.openstack.placement.objects.resource_provider.LOG')
@mock.patch('placement.objects.resource_provider.LOG')
def test_set_allocations_retry(self, mock_log):
"""Test server side allocation write retry handling."""
@ -1766,7 +1766,7 @@ class TestAllocationListCreateDelete(tb.PlacementDbBaseTestCase):
unmocked_set = functools.partial(
rp_obj.AllocationList._set_allocations, alloc_list)
with mock.patch(
'nova.api.openstack.placement.objects.resource_provider.'
'placement.objects.resource_provider.'
'AllocationList._set_allocations') as mock_set:
exceptions = iter([
exception.ResourceProviderConcurrentUpdateDetected(),
@ -1935,7 +1935,7 @@ class ResourceClassTestCase(tb.PlacementDbBaseTestCase):
self.assertEqual(min_id + 1, rc.id)
@mock.patch.object(
nova.api.openstack.placement.objects.resource_provider.ResourceClass,
placement.objects.resource_provider.ResourceClass,
"_get_next_id")
def test_create_duplicate_id_retry(self, mock_get):
# This order of ID generation will create rc1 with an ID of 42, try to
@ -1955,7 +1955,7 @@ class ResourceClassTestCase(tb.PlacementDbBaseTestCase):
self.assertEqual(rc2.id, 43)
@mock.patch.object(
nova.api.openstack.placement.objects.resource_provider.ResourceClass,
placement.objects.resource_provider.ResourceClass,
"_get_next_id")
def test_create_duplicate_id_retry_failing(self, mock_get):
"""negative case for test_create_duplicate_id_retry"""

View File

@ -10,8 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
from nova.api.openstack.placement import exception
from nova.api.openstack.placement.objects import user as user_obj
from placement import exception
from placement.objects import user as user_obj
from nova.tests.functional.db import test_base as tb
from nova.tests import uuidsentinel as uuids

View File

@ -20,12 +20,12 @@ from oslo_policy import opts as policy_opts
from oslo_utils import uuidutils
from oslotest import output
from nova.api.openstack.placement import context
from nova.api.openstack.placement import deploy
from nova.api.openstack.placement.objects import project as project_obj
from nova.api.openstack.placement.objects import resource_provider as rp_obj
from nova.api.openstack.placement.objects import user as user_obj
from nova.api.openstack.placement import policies
from placement import context
from placement import deploy
from placement.objects import project as project_obj
from placement.objects import resource_provider as rp_obj
from placement.objects import user as user_obj
from placement import policies
from nova import rc_fields as fields
from nova.tests import fixtures
from nova.tests.functional.db import test_base as tb

View File

@ -16,7 +16,7 @@ from oslo_config import fixture as config_fixture
from oslo_utils import uuidutils
from wsgi_intercept import interceptor
from nova.api.openstack.placement import deploy
from placement import deploy
CONF = cfg.CONF

View File

@ -12,7 +12,7 @@
from oslo_config import cfg
from nova.api.openstack.placement import direct
from placement import direct
from nova.tests.functional.api.openstack.placement import base
from nova.tests import uuidsentinel

View File

@ -12,8 +12,8 @@
from oslo_config import cfg
from nova.api.openstack.placement import direct
from nova.api.openstack.placement import handler
from placement import direct
from placement import handler
from nova.tests.functional.api.openstack.placement import base

View File

@ -16,9 +16,9 @@ import six
import testtools
import webob
from nova.api.openstack.placement import exception
from nova.api.openstack.placement.handlers import aggregate
from nova.api.openstack.placement.objects import resource_provider
from placement import exception
from placement.handlers import aggregate
from placement.objects import resource_provider
class TestAggregateHandlerErrors(testtools.TestCase):