From 42299c7b688d52a59a2bfcfaae9aab82b6280bab Mon Sep 17 00:00:00 2001 From: stxue1 <122345910+stxue1@users.noreply.github.com> Date: Thu, 6 Feb 2025 19:27:36 -0800 Subject: [PATCH] Fix ec2nodes for new JSON format (#5208) --- src/toil/lib/ec2nodes.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/toil/lib/ec2nodes.py b/src/toil/lib/ec2nodes.py index ac38bd7395..c3b6056e75 100644 --- a/src/toil/lib/ec2nodes.py +++ b/src/toil/lib/ec2nodes.py @@ -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]) @@ -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()}" )