Merge "Do not perform the tenant stack limit check for admin user" into stable/queens

This commit is contained in:
Zuul 2019-08-08 14:46:21 +00:00 committed by Gerrit Code Review
commit ad54909f42
1 changed files with 7 additions and 5 deletions

View File

@ -668,6 +668,8 @@ class EngineService(service.ServiceBase):
if stack_object.Stack.get_by_name(cnxt, stack_name):
raise exception.StackExists(stack_name=stack_name)
# Do not stack limit check for admin since admin can see all stacks.
if not cnxt.is_admin:
tenant_limit = cfg.CONF.max_stacks_per_tenant
if stack_object.Stack.count_all(cnxt) >= tenant_limit:
message = _("You have reached the maximum stacks per tenant, "