def clear_wildcard_hooks(hc, stack_id, stack_patterns, hook_type,
resource_pattern):
if stack_patterns:
for resource in hc.resources.list(stack_id):
res_name = resource.resource_name
if fnmatch.fnmatchcase(res_name, stack_patterns[0]):
nested_stack = hc.resources.get(
stack_id=stack_id,
resource_name=res_name)
clear_wildcard_hooks(
hc,
nested_stack.physical_resource_id,
stack_patterns[1:], hook_type, resource_pattern)
else:
for resource in hc.resources.list(stack_id):
res_name = resource.resource_name
if fnmatch.fnmatchcase(res_name, resource_pattern):
clear_hook(hc, stack_id, res_name, hook_type)
评论列表
文章目录