diff options
author | Tzu-Mainn Chen <tzumainn@redhat.com> | 2019-11-21 21:27:36 +0000 |
---|---|---|
committer | Tzu-Mainn Chen <tzumainn@redhat.com> | 2019-12-10 19:00:33 +0000 |
commit | 3fbb560af1e4d53e701c423311e4d01cb5b1f62a (patch) | |
tree | 34cbfbc05105f09efa2914e7ab1f714e66206d62 /ironic/api/controllers/v1/utils.py | |
parent | 306aaccca6f47b986c725b02fba16c4a414eacbc (diff) | |
download | ironic-3fbb560af1e4d53e701c423311e4d01cb5b1f62a.tar.gz |
Add owner to allocations and create relevant policies
Add an owner to allocations. Depending on policy, a non-admin
can then create an allocation and have the owner set to their
project. Allocation processing then respects the owner.
Change-Id: I2965a4a601b9fa2c0212097da37b104a3e5514df
Story: #2006506
Task: #37540
Diffstat (limited to 'ironic/api/controllers/v1/utils.py')
-rw-r--r-- | ironic/api/controllers/v1/utils.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ironic/api/controllers/v1/utils.py b/ironic/api/controllers/v1/utils.py index e7bb207e6..cb8156db8 100644 --- a/ironic/api/controllers/v1/utils.py +++ b/ironic/api/controllers/v1/utils.py @@ -1248,3 +1248,11 @@ def allow_allocation_backfill(): Version 1.58 of the API added support for backfilling allocations. """ return api.request.version.minor >= versions.MINOR_58_ALLOCATION_BACKFILL + + +def allow_allocation_owner(): + """Check if allocation owner field is allowed. + + Version 1.60 of the API added the owner field to the allocation object. + """ + return api.request.version.minor >= versions.MINOR_60_ALLOCATION_OWNER |