diff options
author | Dmitry Tantsur <divius.inside@gmail.com> | 2019-03-27 17:30:48 +0100 |
---|---|---|
committer | Dmitry Tantsur <divius.inside@gmail.com> | 2019-05-21 20:09:21 +0200 |
commit | 8f6bf4f9dd3f3e27e0c0cf0fab06601a9904f2f7 (patch) | |
tree | 9cebf68a65f4fd1260b51cf994507a92f07b2993 /ironic/tests/unit/api/utils.py | |
parent | 5edf4f3fdabedd1ae55ba94b65379c2e33cdfeae (diff) | |
download | ironic-8f6bf4f9dd3f3e27e0c0cf0fab06601a9904f2f7.tar.gz |
Allocation API: backfilling allocations
This feature addresses the case of moving the already deployed nodes
under the allocation API.
Change-Id: I29d0bd3663e0d1b27727a700c0f0e0fb6ceac1d9
Story: #2005014
Task: #29491
Diffstat (limited to 'ironic/tests/unit/api/utils.py')
-rw-r--r-- | ironic/tests/unit/api/utils.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ironic/tests/unit/api/utils.py b/ironic/tests/unit/api/utils.py index 7addd2e8d..30444d00a 100644 --- a/ironic/tests/unit/api/utils.py +++ b/ironic/tests/unit/api/utils.py @@ -189,12 +189,16 @@ def post_get_test_portgroup(**kw): _ALLOCATION_POST_FIELDS = {'resource_class', 'uuid', 'traits', - 'candidate_nodes', 'name', 'extra'} + 'candidate_nodes', 'name', 'extra', + 'node'} -def allocation_post_data(**kw): +def allocation_post_data(node=None, **kw): """Return an Allocation object without internal attributes.""" allocation = db_utils.get_test_allocation(**kw) + if node: + # This is not a database field, so it has to be handled explicitly + allocation['node'] = node return {key: value for key, value in allocation.items() if key in _ALLOCATION_POST_FIELDS} |