diff options
author | Nakul Dahiwade <nakul.dahiwade@intel.com> | 2018-08-17 18:46:50 +0000 |
---|---|---|
committer | Rabi Mishra <ramishra@redhat.com> | 2019-07-26 04:22:34 +0000 |
commit | 45c259afd0f3cc0689cc2850ce35ff99d3b97a27 (patch) | |
tree | f6cfb0f1160a225bd19ae117d60c6cdc22e2f74e | |
parent | c4c7f1a707c3d9920313e02707a6fe0c3080ae1b (diff) | |
download | heat-45c259afd0f3cc0689cc2850ce35ff99d3b97a27.tar.gz |
Do not perform the tenant stack limit check for admin user
Removing stack creation limit for admin since admin can view all stacks,
and stacks created by other tenants would have been counted in the limit
check.
Change-Id: Ie2e9251245e7e16309661154e17724e5984c21e6
Story: 2003487
Task: 24756
(cherry picked from commit 22b14ff975f885c26b861d4d1b22577cca189e04)
-rw-r--r-- | heat/engine/service.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/heat/engine/service.py b/heat/engine/service.py index 3b5b7c1d7..7cac61d2b 100644 --- a/heat/engine/service.py +++ b/heat/engine/service.py @@ -663,11 +663,13 @@ class EngineService(service.ServiceBase): if stack_object.Stack.get_by_name(cnxt, stack_name): raise exception.StackExists(stack_name=stack_name) - 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, " - "%d. Please delete some stacks.") % tenant_limit - raise exception.RequestLimitExceeded(message=message) + # 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, " + "%d. Please delete some stacks.") % tenant_limit + raise exception.RequestLimitExceeded(message=message) self._validate_template(cnxt, parsed_template) def _validate_template(self, cnxt, parsed_template): |