[placement] Unregister the Inventory object
Unregister the Inventory 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 Inventory class * where objects.Inventory is used, point directly to the nova.objects.resource_provider package instead Partially-Implements: bp placement-deregister-objects Change-Id: Ideca0f09f5dc4ba6bb194a2413ed93cf592dd963
This commit is contained in:
parent
54313c54e9
commit
90cce3378f
nova
@ -150,7 +150,7 @@ def _make_inventory_object(resource_provider, resource_class, **data):
|
||||
# 0) for non-negative integers. It's not clear if that is
|
||||
# duplication or decoupling so leaving it as this for now.
|
||||
try:
|
||||
inventory = objects.Inventory(
|
||||
inventory = rp_obj.Inventory(
|
||||
resource_provider=resource_provider,
|
||||
resource_class=resource_class, **data)
|
||||
except (ValueError, TypeError) as exc:
|
||||
|
@ -122,7 +122,7 @@ 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()
|
||||
inventory = objects.Inventory(
|
||||
inventory = rp_obj.Inventory(
|
||||
self.context, resource_provider=rp,
|
||||
resource_class='DISK_GB', total=2048,
|
||||
step_size=10, min_unit=10, max_unit=600)
|
||||
@ -150,7 +150,7 @@ 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()
|
||||
inventory = objects.Inventory(
|
||||
inventory = rp_obj.Inventory(
|
||||
self.context, resource_provider=rp,
|
||||
resource_class='VCPU', total=10,
|
||||
max_unit=4)
|
||||
@ -238,7 +238,7 @@ class SharedStorageFixture(APIFixture):
|
||||
|
||||
# Populate compute node inventory for VCPU and RAM
|
||||
for cn in (cn1, cn2):
|
||||
vcpu_inv = objects.Inventory(
|
||||
vcpu_inv = rp_obj.Inventory(
|
||||
self.context,
|
||||
resource_provider=cn,
|
||||
resource_class='VCPU',
|
||||
@ -249,7 +249,7 @@ class SharedStorageFixture(APIFixture):
|
||||
step_size=1,
|
||||
allocation_ratio=16.0)
|
||||
vcpu_inv.obj_set_defaults()
|
||||
ram_inv = objects.Inventory(
|
||||
ram_inv = rp_obj.Inventory(
|
||||
self.context,
|
||||
resource_provider=cn,
|
||||
resource_class='MEMORY_MB',
|
||||
@ -264,7 +264,7 @@ class SharedStorageFixture(APIFixture):
|
||||
cn.set_inventory(inv_list)
|
||||
|
||||
# Populate shared storage provider with DISK_GB inventory
|
||||
disk_inv = objects.Inventory(
|
||||
disk_inv = rp_obj.Inventory(
|
||||
self.context,
|
||||
resource_provider=ss,
|
||||
resource_class='DISK_GB',
|
||||
|
Loading…
x
Reference in New Issue
Block a user