1
0
Fork 0
forked from infra/ansible

communishift: debugging efs config

Signed-off-by: David Kirwan <davidkirwanirl@gmail.com>
This commit is contained in:
David Kirwan 2026-05-11 13:10:35 +01:00
commit d99f6f030e
Signed by untrusted user: dkirwan
GPG key ID: A5893AB6474AC37D

View file

@ -120,9 +120,15 @@ def find_filesystem_id_by_creation_token(efs_client, creation_token):
def matching_access_points(efs_client, filesystem_id, project_name):
expected_path = "/{0}".format(project_name)
matching = []
paginator = efs_client.get_paginator("describe_access_points")
for page in paginator.paginate(FileSystemId=filesystem_id):
for ap in page.get("AccessPoints", []):
# describe_access_points has no botocore paginator on many versions (OperationNotPageableError).
marker = None
while True:
kw = {"FileSystemId": filesystem_id}
if marker:
kw["Marker"] = marker
response = efs_client.describe_access_points(**kw)
for ap in response.get("AccessPoints", []):
tags = {t["Key"]: t["Value"] for t in ap.get("Tags", [])}
if tags.get("communishift") != project_name:
continue
@ -130,6 +136,10 @@ def matching_access_points(efs_client, filesystem_id, project_name):
if root_path != expected_path:
continue
matching.append(ap["AccessPointId"])
marker = response.get("NextMarker") or response.get("NextToken")
if not marker:
break
return matching