File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -2447,9 +2447,13 @@ def _instance_type_from_capacity_reservation(self):
2447
2447
self .capacity_reservation_target .capacity_reservation_id if self .capacity_reservation_target else None
2448
2448
)
2449
2449
if capacity_reservation_id :
2450
- capacity_reservations = AWSApi .instance ().ec2 .describe_capacity_reservations ([capacity_reservation_id ])
2451
- if capacity_reservations :
2452
- instance_type = capacity_reservations [0 ].instance_type ()
2450
+ try :
2451
+ capacity_reservations = AWSApi .instance ().ec2 .describe_capacity_reservations ([capacity_reservation_id ])
2452
+ if capacity_reservations :
2453
+ instance_type = capacity_reservations [0 ].instance_type ()
2454
+ except AWSClientError :
2455
+ # In case the CR has expired and we are unable to retrieve the instance type
2456
+ instance_type = None
2453
2457
return instance_type
2454
2458
2455
2459
You can’t perform that action at this time.
0 commit comments