oslo.limit/oslo_limit
Dan Smith a49f3a04d0 Make calculate_usage() work if limits are missing
The calculate_usage interface was added recently to allow consumers
to probe limits and usage without requiring the enforce behavior
workflow. If a limit was passed to it that was not registered in
keystone, get_project_limits() would raise a ProjectOverLimit
exception itself to abort the process immediately, providing the
"unregistered means zero" behavior. This works fine for the enforce
workflow, but not the calculate one.

This changes get_project_limits() to just return a zero limit for
a missing one, which will be considered by the enforce workflow in
the same way, keeping the existing behavior. It will merely be
reported by the calculate workflow, which is the desired change.

Change-Id: Iaab1f0d5eb0da9a667267537d86f6c70bc8db51d
2022-01-10 13:44:01 -08:00
..
tests Make calculate_usage() work if limits are missing 2022-01-10 13:44:01 -08:00
__init__.py Init repo 2018-05-17 18:06:06 +08:00
_i18n.py ADD i18n file 2018-07-30 16:15:03 +08:00
exception.py Add flat enforcer 2019-11-25 18:30:28 +00:00
fixture.py Add caching of limits in Enforcer 2021-10-18 21:43:57 +00:00
limit.py Make calculate_usage() work if limits are missing 2022-01-10 13:44:01 -08:00
opts.py Add auth plugin options to options list 2021-10-12 08:37:37 +09:00