diff --git a/roles/communishift/library/communishift_storage_efs.py b/roles/communishift/library/communishift_storage_efs.py index 1805ba373e..2c15d1a9e7 100644 --- a/roles/communishift/library/communishift_storage_efs.py +++ b/roles/communishift/library/communishift_storage_efs.py @@ -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