mirror of
https://github.com/ansible/awx.git
synced 2026-02-25 06:56:00 -03:30
Limit max depth when building mapping of group depths to avoid hitting recursion limit. Fixes https://trello.com/c/2zc0odvX
This commit is contained in:
committed by
Matthew Jones
parent
1982177248
commit
001127f8bd
@@ -222,6 +222,9 @@ class Inventory(CommonModel):
|
||||
|
||||
def update_group_depths(group_pk, current_depth=0):
|
||||
max_depth = group_depths.get(group_pk, -1)
|
||||
# Arbitrarily limit depth to avoid hitting Python recursion limit (which defaults to 1000).
|
||||
if current_depth > 100:
|
||||
return
|
||||
if current_depth > max_depth:
|
||||
group_depths[group_pk] = current_depth
|
||||
for child_pk in group_children_map.get(group_pk, set()):
|
||||
|
||||
Reference in New Issue
Block a user