Skip to content

Commit

Permalink
Fix ec2nodes for new JSON format (#5208)
Browse files Browse the repository at this point in the history
  • Loading branch information
stxue1 authored Feb 7, 2025
1 parent 82f5049 commit 42299c7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/toil/lib/ec2nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def parse_storage(
return [0, 0]
else:
specs = storage_info.strip().split()
if is_number(specs[0]) and specs[1] == "x" and is_number(specs[2]):
if is_number(specs[0]) and specs[1].lower() == "x" and is_number(specs[2]):
return float(specs[0].replace(",", "")), float(specs[2].replace(",", ""))
elif (
is_number(specs[0])
Expand All @@ -157,9 +157,11 @@ def parse_storage(
and specs[3] == "SSD"
):
return 1, float(specs[0].replace(",", ""))
elif is_number(specs[0]) and specs[1].lower() == "x" and is_number(specs[2][:-2]) and specs[2][-2:] == "GB":
return float(specs[0].replace(",", "")), float(specs[2][:-2].replace(",", ""))
else:
raise RuntimeError(
"EC2 JSON format has likely changed. Error parsing disk specs."
f"EC2 JSON format has likely changed. Error parsing disk specs : {storage_info.strip()}"
)


Expand Down

0 comments on commit 42299c7

Please sign in to comment.