Skip to content

Commit 47c1a88

Browse files
committed
PlacementGroupInfo is not a required entry
1 parent b1f7b64 commit 47c1a88

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

citc/aws.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ def get_types_info(client: EC2Client) -> Dict[str, NodeTypeInfo]:
9393
for page in client.get_paginator("describe_instance_types").paginate()
9494
for i in page["InstanceTypes"]
9595
}
96+
97+
def is_cluster_group(d):
98+
if "PlacementGroupInfo" not in d:
99+
return False
100+
return "cluster" in d["PlacementGroupInfo"]["SupportedStrategies"]
101+
96102
return {
97103
s: {
98104
"memory": d["MemoryInfo"]["SizeInMiB"]
@@ -102,7 +108,7 @@ def get_types_info(client: EC2Client) -> Dict[str, NodeTypeInfo]:
102108
),
103109
"threads_per_core": d["VCpuInfo"].get("DefaultThreadsPerCore", 1),
104110
"arch": d["ProcessorInfo"]["SupportedArchitectures"][0],
105-
"cluster_group": 'cluster' in d["PlacementGroupInfo"]["SupportedStrategies"]
111+
"cluster_group": is_cluster_group(d),
106112
}
107113
for s, d in instances.items()
108114
}

0 commit comments

Comments
 (0)