nova/nova/tests
melanie witt 4c11d5467a Default user_id when not specified in check_num_instances_quota
The Quotas.check_deltas method needs a user_id keyword arg in order to
scope a quota check to a particular user. However, when we call
check_num_instances_quota we don't pass a project_id or user_id because
at the time of the quota check, we have not yet created an instance
record and thus will not use that to determine the appropriate project
and user.

Instead, we should rely on the RequestContext.project_id and
RequestContext.user_id as defaults in this case, but
check_num_instances_quota only defaults project_id and not user_id.

check_num_instances_quota should also default user_id to the
RequestContext.user_id when user_id is not explicitly passed.

check_num_instances_quota should also check whether any per-user quota
limits are defined for instance-related resources before passing along
the user_id to scope resource counting and limit checking. Counting
resources across a user is costly, so we should avoid it if it's not
needed.

Closes-Bug: #1893284

Change-Id: I3cfb1edc30b0bda4671e0d2cc2a8993055dcc9ff
2020-08-29 03:25:31 +00:00
..
functional Default user_id when not specified in check_num_instances_quota 2020-08-29 03:25:31 +00:00
unit Default user_id when not specified in check_num_instances_quota 2020-08-29 03:25:31 +00:00
__init__.py
fixtures.py Ensure source compute is up when confirming a resize 2020-08-26 14:50:07 +01:00
json_ref.py Transform instance.exists notification 2018-06-05 12:51:30 +00:00