forked from infra/ansible
communishift: debugging efs config
Signed-off-by: David Kirwan <davidkirwanirl@gmail.com>
This commit is contained in:
parent
2002267fcb
commit
d99f6f030e
1 changed files with 13 additions and 3 deletions
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue