[placement] Unregister the Allocation object

Unregister the Allocation object because we do not need RPC and
versioning for the objects in nova.objects.resource_provider.

There are two primary changes here:

* unregistering the Allocation class
* where objects.Allocation is used, point directly to the
  nova.objects.resource_provider package instead

Partially-Implements: bp placement-deregister-objects
Change-Id: Ib026438b5f843fce848277347a95f3c4b6f94fb1
This commit is contained in:
Chris Dent 2017-09-08 18:28:19 +01:00
parent 765d645abe
commit 52ee2b702e
2 changed files with 7 additions and 7 deletions
nova
api/openstack/placement/handlers
tests/functional/api/openstack/placement

@ -236,7 +236,7 @@ def _set_allocations(req, schema):
resources = allocation['resources']
for resource_class in resources:
allocation = objects.Allocation(
allocation = rp_obj.Allocation(
resource_provider=resource_provider,
consumer_id=consumer_uuid,
resource_class=resource_class,

@ -128,12 +128,12 @@ class AllocationFixture(APIFixture):
step_size=10, min_unit=10, max_unit=600)
inventory.obj_set_defaults()
rp.add_inventory(inventory)
alloc1 = objects.Allocation(
alloc1 = rp_obj.Allocation(
self.context, resource_provider=rp,
resource_class='DISK_GB',
consumer_id=consumer_id,
used=500)
alloc2 = objects.Allocation(
alloc2 = rp_obj.Allocation(
self.context, resource_provider=rp,
resource_class='DISK_GB',
consumer_id=consumer_id,
@ -156,12 +156,12 @@ class AllocationFixture(APIFixture):
max_unit=4)
inventory.obj_set_defaults()
rp.add_inventory(inventory)
alloc1 = objects.Allocation(
alloc1 = rp_obj.Allocation(
self.context, resource_provider=rp,
resource_class='VCPU',
consumer_id=consumer_id,
used=2)
alloc2 = objects.Allocation(
alloc2 = rp_obj.Allocation(
self.context, resource_provider=rp,
resource_class='VCPU',
consumer_id=consumer_id,
@ -177,12 +177,12 @@ class AllocationFixture(APIFixture):
# Each set of allocations must have the same consumer_id because only
# the first allocation is used for the project/user association.
consumer_id = uuidutils.generate_uuid()
alloc1 = objects.Allocation(
alloc1 = rp_obj.Allocation(
self.context, resource_provider=rp,
resource_class='DISK_GB',
consumer_id=consumer_id,
used=20)
alloc2 = objects.Allocation(
alloc2 = rp_obj.Allocation(
self.context, resource_provider=rp,
resource_class='VCPU',
consumer_id=consumer_id,