File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -248,7 +248,9 @@ async def launch_instances(
248248 break
249249 except botocore .exceptions .ClientError as exc :
250250 error_code = exc .response .get ("Error" , {}).get ("Code" )
251- if error_code == "InsufficientInstanceCapacity" :
251+ if error_code == "500" and (
252+ "InsufficientInstanceCapacity" in f"{ exc } "
253+ ):
252254 _logger .warning (
253255 "Insufficient capacity in subnet %s for instance type %s, trying next subnet" ,
254256 subnet_id ,
Original file line number Diff line number Diff line change @@ -623,7 +623,7 @@ async def mock_run_instances(*args, **kwargs) -> Any:
623623 # First call (first subnet) - simulate insufficient capacity
624624 error_response : dict [str , Any ] = {
625625 "Error" : {
626- "Code" : "InsufficientInstanceCapacity " ,
626+ "Code" : "500 " ,
627627 "Message" : "Insufficient capacity." ,
628628 },
629629 }
@@ -707,7 +707,7 @@ async def mock_run_instances(*args, **kwargs) -> Any:
707707 # Always simulate insufficient capacity
708708 error_response = {
709709 "Error" : {
710- "Code" : "InsufficientInstanceCapacity " ,
710+ "Code" : "500 " ,
711711 "Message" : "Insufficient capacity." ,
712712 },
713713 }
@@ -784,7 +784,7 @@ async def mock_run_instances(*args, **kwargs):
784784 # Second call: simulate insufficient capacity (subnet is full)
785785 error_response = {
786786 "Error" : {
787- "Code" : "InsufficientInstanceCapacity " ,
787+ "Code" : "500 " ,
788788 "Message" : "Insufficient capacity." ,
789789 },
790790 }
You can’t perform that action at this time.
0 commit comments