placement/placement/tests/unit/objects
Surya Seetharaman b1f3dd39c3 Add consumer_types migration, database and object changes
In advance of a microversion 1.38, add the necessary database and
object code to support saving consumer types when creating consumers
and reporting those types when requesting usage information.

This patch adds a new table called ``consumer_types`` and also
add a new column called ``consumer_type_id`` that references the id
in the consumer_types table.

The consumer_type_id is nullable and records with a NULL
consumer_type_id are considered as 'unknown'.

In future changes we may wish to AttributeCache consumer types in
the same way that traits and resource classes are cached.

Usage object can now be retrieved by consumer type and include
consumer type information when retrieved. Until 1.38 that info
will not be used in results.

Allocations are written and retrieved with a consumer type but
the data is not yet presented in HTTP requests.

Co-Authored-By: Chris Dent <cdent@anticdent.org>
Co-Authored-By: melanie witt <melwittt@gmail.com>

Story: 2005473
Task: 35683
Task: 36420

Change-Id: Ic74c3d1b8aa272e9c7d1070fe7658b928e693889
2021-08-05 23:23:46 +00:00
..
__init__.py Move the unit tests 2018-09-04 10:31:24 -05:00
base.py Move rc_cache onto RequestContext 2019-07-18 11:04:48 +01:00
test_allocation.py Add consumer_types migration, database and object changes 2021-08-05 23:23:46 +00:00
test_allocation_candidate.py Use unittest.mock instead of third party mock 2020-04-30 12:01:27 -05:00
test_inventory.py Use unittest.mock instead of third party mock 2020-04-30 12:01:27 -05:00
test_resource_class.py Move ResourceClass and ResourceClassList to own module 2019-03-07 12:19:42 +00:00
test_resource_provider.py Remove all usage of six library 2020-06-09 14:13:53 +02:00
test_rp_candidates.py Remove pep8 whitespace ignores 2019-03-05 18:18:30 -06:00
test_trait.py Use unittest.mock instead of third party mock 2020-04-30 12:01:27 -05:00
test_usage.py Use native list for lists of Usage 2019-03-04 14:37:11 +00:00