nova.exception -> placement.exception in docstrings and comment
A simple cleanup to adjust comments and docstrings to change "nova.exception" to "placement.exception", including removing some comments that are no longer relevant. Change-Id: Ia91f89c8fb529382446342229b14387b2c898ddc
This commit is contained in:
parent
d4a730aad7
commit
44aea7f33a
|
@ -11,11 +11,6 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
"""Exceptions for use in the Placement API."""
|
"""Exceptions for use in the Placement API."""
|
||||||
|
|
||||||
# NOTE(cdent): The exceptions are copied from nova.exception, where they
|
|
||||||
# were originally used. To prepare for extracting placement to its own
|
|
||||||
# repository we wish to no longer do that. Instead, exceptions used by
|
|
||||||
# placement should be in the placement hierarchy.
|
|
||||||
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
|
|
||||||
from placement.i18n import _
|
from placement.i18n import _
|
||||||
|
@ -161,8 +156,6 @@ class ResourceClassNotFound(NotFound):
|
||||||
msg_fmt = _("No such resource class %(resource_class)s.")
|
msg_fmt = _("No such resource class %(resource_class)s.")
|
||||||
|
|
||||||
|
|
||||||
# An exception with this name is used on both sides of the placement/
|
|
||||||
# nova interaction.
|
|
||||||
class ResourceProviderInUse(_BaseException):
|
class ResourceProviderInUse(_BaseException):
|
||||||
msg_fmt = _("Resource provider has allocations.")
|
msg_fmt = _("Resource provider has allocations.")
|
||||||
|
|
||||||
|
|
|
@ -135,10 +135,11 @@ def _increment_consumer_generation(ctx, consumer):
|
||||||
:param ctx: `nova.context.RequestContext` that contains an oslo_db Session
|
:param ctx: `nova.context.RequestContext` that contains an oslo_db Session
|
||||||
:param consumer: `Consumer` whose generation should be updated.
|
:param consumer: `Consumer` whose generation should be updated.
|
||||||
:returns: The newly-incremented generation.
|
:returns: The newly-incremented generation.
|
||||||
:raises nova.exception.ConcurrentUpdateDetected: if another thread updated
|
:raises placement.exception.ConcurrentUpdateDetected: if another thread
|
||||||
the same consumer's view of its allocations in between the time
|
updated the same consumer's view of its allocations in between the
|
||||||
when this object was originally read and the call which modified
|
time when this object was originally read and the call which
|
||||||
the consumer's state (e.g. replacing allocations for a consumer)
|
modified the consumer's state (e.g. replacing allocations for a
|
||||||
|
consumer)
|
||||||
"""
|
"""
|
||||||
consumer_gen = consumer.generation
|
consumer_gen = consumer.generation
|
||||||
new_generation = consumer_gen + 1
|
new_generation = consumer_gen + 1
|
||||||
|
@ -241,7 +242,7 @@ class Consumer(base.VersionedObject, base.TimestampedObject):
|
||||||
def increment_generation(self):
|
def increment_generation(self):
|
||||||
"""Increments the consumer's generation.
|
"""Increments the consumer's generation.
|
||||||
|
|
||||||
:raises nova.exception.ConcurrentUpdateDetected: if another thread
|
:raises placement.exception.ConcurrentUpdateDetected: if another thread
|
||||||
updated the same consumer's view of its allocations in between the
|
updated the same consumer's view of its allocations in between the
|
||||||
time when this object was originally read and the call which
|
time when this object was originally read and the call which
|
||||||
modified the consumer's state (e.g. replacing allocations for a
|
modified the consumer's state (e.g. replacing allocations for a
|
||||||
|
|
|
@ -264,10 +264,10 @@ def _increment_provider_generation(ctx, rp):
|
||||||
:param ctx: `nova.context.RequestContext` that contains an oslo_db Session
|
:param ctx: `nova.context.RequestContext` that contains an oslo_db Session
|
||||||
:param rp: `ResourceProvider` whose generation should be updated.
|
:param rp: `ResourceProvider` whose generation should be updated.
|
||||||
:returns: The new resource provider generation value if successful.
|
:returns: The new resource provider generation value if successful.
|
||||||
:raises nova.exception.ConcurrentUpdateDetected: if another thread updated
|
:raises placement.exception.ConcurrentUpdateDetected: if another thread
|
||||||
the same resource provider's view of its inventory or allocations
|
updated the same resource provider's view of its inventory or
|
||||||
in between the time when this object was originally read
|
allocations in between the time when this object was originally
|
||||||
and the call to set the inventory.
|
read and the call to set the inventory.
|
||||||
"""
|
"""
|
||||||
rp_gen = rp.generation
|
rp_gen = rp.generation
|
||||||
new_generation = rp_gen + 1
|
new_generation = rp_gen + 1
|
||||||
|
@ -337,10 +337,10 @@ def _set_inventory(context, rp, inv_list):
|
||||||
:param inv_list: `InventoryList` object to save to backend storage.
|
:param inv_list: `InventoryList` object to save to backend storage.
|
||||||
:returns: A list of (uuid, class) tuples that have exceeded their
|
:returns: A list of (uuid, class) tuples that have exceeded their
|
||||||
capacity after this inventory update.
|
capacity after this inventory update.
|
||||||
:raises nova.exception.ConcurrentUpdateDetected: if another thread updated
|
:raises placement.exception.ConcurrentUpdateDetected: if another thread
|
||||||
the same resource provider's view of its inventory or allocations
|
updated the same resource provider's view of its inventory or
|
||||||
in between the time when this object was originally read
|
allocations in between the time when this object was originally
|
||||||
and the call to set the inventory.
|
read and the call to set the inventory.
|
||||||
:raises `exception.ResourceClassNotFound` if any resource class in any
|
:raises `exception.ResourceClassNotFound` if any resource class in any
|
||||||
inventory in inv_list cannot be found in either the standard
|
inventory in inv_list cannot be found in either the standard
|
||||||
classes or the DB.
|
classes or the DB.
|
||||||
|
|
Loading…
Reference in New Issue