summaryrefslogtreecommitdiff
path: root/keystone/limit
diff options
context:
space:
mode:
authorwangxiyuan <wangxiyuan@huawei.com>2018-07-05 17:30:07 +0800
committerwangxiyuan <wangxiyuan@huawei.com>2018-07-19 11:46:00 +0800
commit8e44aa3b97e1892b0648177d1cb5836cfe5795e7 (patch)
treecd70b71c24b508a9fa64b399ae458f3df2cf51fa /keystone/limit
parenta7d4a9bd4c620dae127b53fed8bdaf0ea3055635 (diff)
downloadkeystone-8e44aa3b97e1892b0648177d1cb5836cfe5795e7.tar.gz
Add project hierarchical tree check when Keystone start
Add a check function for project hierarchical tree check when starting Keystone. If the tree depth exceed the enforcement model's depth, fail to start keystone process Change-Id: I4ce6a48505b8b9688bbdd18ee46ce035ee0938ed bp: strict-two-level-model
Diffstat (limited to 'keystone/limit')
-rw-r--r--keystone/limit/core.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/keystone/limit/core.py b/keystone/limit/core.py
index 3c2109d55..6f798dec8 100644
--- a/keystone/limit/core.py
+++ b/keystone/limit/core.py
@@ -39,6 +39,11 @@ class Manager(manager.Manager):
self.enforcement_model = base.load_driver(
CONF.unified_limit.enforcement_model)
+ def check_project_depth(self):
+ """Check project depth if satisfy current enforcement model or not."""
+ PROVIDERS.resource_api.check_project_depth(
+ self.enforcement_model.MAX_PROJECT_TREE_DEPTH)
+
def _assert_resource_exist(self, unified_limit, target):
try:
service_id = unified_limit.get('service_id')