Browse Source

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

changes/96/677396/1
Zuul 1 month ago
parent
commit
ad54909f42
1 changed files with 7 additions and 5 deletions
  1. 7
    5
      heat/engine/service.py

+ 7
- 5
heat/engine/service.py View File

@@ -668,11 +668,13 @@ class EngineService(service.ServiceBase):
668 668
         if stack_object.Stack.get_by_name(cnxt, stack_name):
669 669
             raise exception.StackExists(stack_name=stack_name)
670 670
 
671
-        tenant_limit = cfg.CONF.max_stacks_per_tenant
672
-        if stack_object.Stack.count_all(cnxt) >= tenant_limit:
673
-            message = _("You have reached the maximum stacks per tenant, "
674
-                        "%d. Please delete some stacks.") % tenant_limit
675
-            raise exception.RequestLimitExceeded(message=message)
671
+        # Do not stack limit check for admin since admin can see all stacks.
672
+        if not cnxt.is_admin:
673
+            tenant_limit = cfg.CONF.max_stacks_per_tenant
674
+            if stack_object.Stack.count_all(cnxt) >= tenant_limit:
675
+                message = _("You have reached the maximum stacks per tenant, "
676
+                            "%d. Please delete some stacks.") % tenant_limit
677
+                raise exception.RequestLimitExceeded(message=message)
676 678
         self._validate_template(cnxt, parsed_template)
677 679
 
678 680
     def _validate_template(self, cnxt, parsed_template):

Loading…
Cancel
Save