Skip to content

Commit b4f4702

Browse files
committed
Through error if no nodes are launched
1 parent e45dfd8 commit b4f4702

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/slurm_plugin/fleet_manager.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@ def launch_ec2_instances(self, count, job_id=None):
198198
print_with_count([instance.get("InstanceId", "") for instance in assigned_nodes.get("Instances")]),
199199
)
200200
logger.debug("Launched instances information: %s", assigned_nodes.get("Instances"))
201+
elif len(assigned_nodes.get("Errors")) > 0:
202+
raise assigned_nodes.get("Errors")[0]
201203

202204
return [EC2Instance.from_describe_instance_data(instance_info) for instance_info in assigned_nodes["Instances"]]
203205

@@ -422,7 +424,7 @@ def _launch_instances(self, launch_params):
422424

423425
if not instances and len(err_list) == 1:
424426
raise LaunchInstancesError(err_list[0].get("ErrorCode"), err_list[0].get("ErrorMessage"))
425-
return {"Instances": instances}
427+
return {"Instances": instances, "Errors": err_list}
426428
except ClientError as e:
427429
logger.error(
428430
"Failed CreateFleet request (%s): %s - %s",

0 commit comments

Comments
 (0)